// Use this for initialization void Start() { Health = 2; _player = GameObject.FindGameObjectWithTag("Player").GetComponent <BasePlayerScript>(); Animator = transform.Find("Model").GetComponent <Animator>(); _indicator = transform.Find("Indicator").GetComponent <IndicatorScript>(); _startRot = transform.rotation; _snd = GetComponent <SoundManager>(); //behaviour tree _rootNode = new SequenceNode( new ActionNode(Animate), new SelectorNode( new SequenceNode( new SelectorNode( new ConditionNode(PlayerSpottedAndInRange), new ConditionNode(HitByBarrel) ), new ActionNode(AimAndShoot) ), new ActionNode(StandGuard) ) ) ; StartCoroutine("RunTree"); }
void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); //DontDestroyOnLoad(gameObject); }
// Use this for initialization public void Start() { Health = 2; _agent = GetComponent <NavMeshAgent>(); Animator = transform.Find("Model").GetComponent <Animator>(); _player = GameObject.FindGameObjectWithTag("Player").GetComponent <BasePlayerScript>(); _povTimer = _povTime; _searchTimer = _searchTime; _chaseTimer = _chaseTime; _indicator = transform.Find("Indicator").GetComponent <IndicatorScript>(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } //DontDestroyOnLoad(gameObject); }