//private FoxCollection foxCollection; private void Awake() { //canvas = FindObjectOfType<Canvas>(); //cam = FindObjectOfType<Camera>(); foxAI = GetComponent <FoxAI>(); //foxCollection = FindObjectOfType<FoxCollection>(); }
void FixedUpdate() { Vector2 PlayerPos = Raccoon.transform.position; valX = PlayerPos.x - this.transform.position.x; valY = PlayerPos.y - this.transform.position.y; if (valY < 0 && valY >= -10) { if (valX >= -1 && valX <= 1) { if (gameObject.transform.parent != null) { if (gameObject.transform.parent.gameObject.GetComponent <FoxAI> ().HasBomb == true) { RB.isKinematic = false; gameObject.transform.parent.gameObject.GetComponent <FoxAI> ().HasBomb = false; GameObject Fox = gameObject.transform.parent.gameObject; Col.isTrigger = false; FoxAI brain = Fox.GetComponent <FoxAI>(); brain.Invoke("Dead", 3); gameObject.transform.parent = null; } } } } }
// Use this for initialization void Start() { foxAIController = GetComponentInParent <FoxAI>(); }
private void Awake() { foxAI = GetComponentInParent <FoxAI>(); navMesh = GetComponent <NavMeshAgent>(); }