Polishing 1
General polishing commit
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DarkAmbience : MonoBehaviour {
|
||||
|
||||
private float defaultEnvLightingIntensity, defaultEnfReflectionIntensity;
|
||||
[SerializeField]
|
||||
private float targetEnvLightingIntensity, targetEnfReflectionIntensity;
|
||||
[SerializeField]
|
||||
private float lerpSpeed;
|
||||
[SerializeField]
|
||||
private bool isDark = false;
|
||||
private float t = 0;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
defaultEnvLightingIntensity = RenderSettings.ambientIntensity;
|
||||
defaultEnfReflectionIntensity = RenderSettings.reflectionIntensity;
|
||||
}
|
||||
|
||||
public void SwitchDarkness(bool dark)
|
||||
{
|
||||
isDark = dark;
|
||||
t = 0;
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
t = 0;
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if(other.transform.root.tag == "Player")
|
||||
{
|
||||
SwitchDarkness(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.transform.root.tag == "Player")
|
||||
{
|
||||
SwitchDarkness(false);
|
||||
}
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
if(isDark)
|
||||
{
|
||||
RenderSettings.ambientIntensity = Mathf.Lerp(defaultEnvLightingIntensity, targetEnvLightingIntensity, t);
|
||||
RenderSettings.reflectionIntensity = Mathf.Lerp(defaultEnfReflectionIntensity, targetEnfReflectionIntensity, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderSettings.ambientIntensity = Mathf.Lerp(targetEnvLightingIntensity, defaultEnvLightingIntensity, t);
|
||||
RenderSettings.reflectionIntensity = Mathf.Lerp(targetEnfReflectionIntensity, defaultEnfReflectionIntensity , t);
|
||||
}
|
||||
t += Time.deltaTime * lerpSpeed;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f0436f919a77164da3e5047c1b7795f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,50 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EliminatePlayer : MonoBehaviour {
|
||||
|
||||
[SerializeField]
|
||||
private string name = "Generic trap";
|
||||
[SerializeField]
|
||||
private float resapwnDelay = 0;
|
||||
[Tooltip("Optional particle effect. Spawned when player enters the trigger")]
|
||||
[SerializeField]
|
||||
private GameObject effect;
|
||||
[SerializeField]
|
||||
private LurchRespawn player;
|
||||
[SerializeField]
|
||||
private bool killQueued = false;
|
||||
[SerializeField]
|
||||
private float rdCounter = 0;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
if (rdCounter <= 0 && killQueued)
|
||||
{
|
||||
player.RespawnLurch(name);
|
||||
killQueued = false;
|
||||
} else
|
||||
{
|
||||
rdCounter -= Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.transform.root.tag == "Player")
|
||||
{
|
||||
rdCounter = resapwnDelay;
|
||||
killQueued = true;
|
||||
if(effect != null)
|
||||
{
|
||||
GameObject.Instantiate(effect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 558ac06dec86b64459dd109124ea89be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,54 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TriggerActivate : MonoBehaviour {
|
||||
|
||||
public AudioSource theAudio;
|
||||
public AudioClip theClip;
|
||||
public GameObject theObject;
|
||||
public Rigidbody theRigidBody;
|
||||
private Vector3 startPos;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
if (theObject)
|
||||
{
|
||||
theObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (theRigidBody)
|
||||
{
|
||||
theRigidBody.isKinematic = true;
|
||||
startPos = theRigidBody.transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.transform.root.tag == "Player") {
|
||||
if (theAudio)
|
||||
{
|
||||
theAudio.clip = theClip;
|
||||
theAudio.Play();
|
||||
}
|
||||
|
||||
if (theObject)
|
||||
{
|
||||
theObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (theRigidBody)
|
||||
{
|
||||
theRigidBody.isKinematic = false;
|
||||
theRigidBody.transform.position = startPos;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83c4b1f877f8abd49a2b7e25885df4e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,39 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TriggerDeactivateLight : MonoBehaviour {
|
||||
|
||||
public LightLurch theScript;
|
||||
public Light theLight;
|
||||
public bool activate;
|
||||
public bool deactivate;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.transform.root.tag == "Player")
|
||||
{
|
||||
if (deactivate)
|
||||
{
|
||||
theScript.enabled = false;
|
||||
theLight.enabled = false;
|
||||
}
|
||||
|
||||
if (activate)
|
||||
{
|
||||
theScript.enabled = true;
|
||||
theLight.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16cc9ec86764da94098c2d3773e4e6e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user