// Use this for initialization public override void Start() { firstController = SSDirector.GetInstance().CurrentSceneController as FirstController; player = firstController.GetPlayer(); agent = gameobject.GetComponent <NavMeshAgent>(); }