private void OnTriggerEnter(Collider other) { Scene scene = SceneManager.GetActiveScene(); if (other.gameObject.tag != "TouchCollider" || scene.name == "CharacterSelection") { return; } GameObject otherEntity = other.transform.parent.gameObject; eCatState otherState = otherEntity.GetComponent <CatState>().currentState; if (otherState == eCatState.CHASER && GetComponentInParent <CatState>().currentState == eCatState.CHASED && otherEntity.GetComponent <PlayerController>().canCapture) { DelegateChaser(otherEntity); } }
private void OnTriggerEnter(Collider other) { if (!canBePicked || other.gameObject.tag != "TouchCollider") { return; } GameObject otherEntity = other.transform.parent.gameObject; eCatState otherState = otherEntity.GetComponent <CatState>().currentState; if (otherState == eCatState.CHASED) { CatEnergy energy = otherEntity.GetComponent <CatEnergy>(); energy.RefillTime(timeRefill); DeActivate(); } }
public void SetAsChaser(GameObject touchedChaserCat) { currentState = eCatState.CHASER; }