// Update is called once per frame void Update() { if (currentHealth <= 0 && State != PlayerAnimator.PlayerState.Dying && State != PlayerAnimator.PlayerState.Dead) { //transitioned from alive to dying, do housekeeping here State = PlayerAnimator.PlayerState.Dying; GetComponent<MouseFollower> ().enabled = false; tongue.enabled = false; controller.enabled = false; collider.enabled = false; GameObject.FindGameObjectWithTag("EnemySpawn").GetComponent<EnemySpawn>().enabled = false; GameObject.FindGameObjectWithTag("Gui").GetComponent<Pause>().enabled = false; } if (currentHealth <= 0 && State == PlayerAnimator.PlayerState.Dead) { initiateGameOver (); } accel = new Vector3 (Input.GetAxis ("Horizontal"), 0f, Input.GetAxis ("Vertical")); }
// Use this for initialization void Start() { currentHealth = maxHealth; currentEnergy = maxEnergy; aCalib = Input.acceleration; score = 0; streak = 0; controller = GetComponent<CharacterController> (); //Pause.setPause(false); comboScript = GetComponent<Combo> (); //cheat detect hasCheated = false; scoreCheck = cheatOffset; numTimesIncrementScore = 0; changingScore = false; tongue = GameObject.Find ("Tongue").GetComponent<NewTongue> (); LastState = PlayerAnimator.PlayerState.TongueIn; _state = PlayerAnimator.PlayerState.TongueIn; tripMode = GetComponent<TripMode> (); }