// Use this for initialization void Start() { gamecontrolleur = FindObjectOfType <gamecontrolleur>(); stateMachine = new EnnemyStateMachine(); GameObject goPlayer = GameObject.FindGameObjectWithTag("Player"); if (goPlayer != null) { player = goPlayer.GetComponent <Player>(); } if (player == null) { Debug.LogError("ERROR : no player ref in Ennemy"); } //Init Nav Mesh Agent nodes = PathFinding.GetComponentsInChildren <PathFindingNode> (); navMeshAgent = GetComponent <NavMeshAgent> (); SetNavMeshTarget(); Debug.Log("Number of Nodes: " + nodes.Length); }
void Start() { gamecontrolleur = FindObjectOfType <gamecontrolleur>(); }