void Awake() { go = gameObject; selfInstance = this; analogGlitch = GetComponent <AnalogGlitch>(); digitalGlitch = GetComponent <DigitalGlitch>(); }
private void OnCollisionEnter(Collision collision) { if (hasBeenShook) { return; } hasBeenShook = true; CameraEffectsController.Shake(); }
/*void OnMouseDrag() * { * //rb.position = GetMouseAsWorldPoint() + mOffset; * * //rb.position = new Vector3( * // Mathf.Clamp(rb.position.x, -xRange, xRange), * // Mathf.Clamp(rb.position.y, -yRange, yRange), * // rb.position.z); * * transform.position = GetMouseAsWorldPoint() + mOffset; * * transform.position = new Vector3( * Mathf.Clamp(transform.position.x, -xRange, xRange), * Mathf.Clamp(transform.position.y, -yRange, yRange), * transform.position.z); * }*/ private void Hit() { // Subtract health health -= 15; // Tell health bar new health value. healthbar.SetHealth(health); // Camera effects. LeanTween.value(gameObject, (float i) => { CameraEffectsController.SetEffect(CameraEffectsController.Effect.ColorDrift, i); CameraEffectsController.SetEffect(CameraEffectsController.Effect.ScanLineJitter, i); }, 0.3f, 0f, 1f); LeanTween.value(gameObject, (float i) => { CameraEffectsController.SetEffect(CameraEffectsController.Effect.DigitalGlitch, i); }, 0.025f, 0f, 0.5f); }
void Awake() { cameraRig = GameObject.FindGameObjectWithTag("CameraRig").GetComponent <CameraEffectsController> (); }
// Start is called before the first frame update void Start() { instance = this; }
private void Awake() { instance = this; animator = GetComponent <Animator>(); }