void Start() { rangeCircle = Instantiate(Resources.Load("RangeCircle")) as GameObject; rangeCircle.transform.parent = this.transform; rangeCircle.transform.localPosition = new Vector3(0.0f, 1.0f, 0.0f); rangeCircle.transform.localScale = new Vector3(Player.shootRange, Player.shootRange, 0f); S_Director.level.GetComponent <S_Level>().AddGameObject(gameObject); AI = gameObject.transform.Find("Actions").GetComponent <Lightbug.CharacterControllerPro.Implementation.CharacterAIBehaviour>(); }
/// <summary> /// Sets the AI behaviour type. /// </summary> public void SetAIBehaviour(CharacterAIBehaviour aiBehaviour) { if (aiBehaviour == null) { return; } characterActions.Reset(); currentAIBehaviour = aiBehaviour; currentAIBehaviour.EnterBehaviour(Time.deltaTime); }