void Start() { behaviorTree = GetComponent <BehaviorTree>(); deathmatchAgent = GetComponent <DeathmatchAgent>(); navMeshAgent = GetComponent <NavMeshAgent>(); if (flowchart == null && flowchartName != null && flowchartName.Trim().Length != 0) { flowchart = GameObject.Find("/Fungus/Flowcharts/" + flowchartName).GetComponent <Fungus.Flowchart>(); } trackEvent.AddListener(TrackTargetsInLayers); }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(this); } audioSettings = GameManager.Instance.gameSettings.audioSettings; onSoundEvent.AddListener(PlaySoundEffect); onTrackEvent.AddListener(PlayBackgroundTrack); }
void Start() { health = GetComponent(typeof(CharacterHealth)) as CharacterHealth; behaviorTree = GetComponent <BehaviorTree>(); deathmatchAgent = GetComponent <DeathmatchAgent>(); navMeshAgent = GetComponent <NavMeshAgent>(); characterController = GetComponent <RigidbodyCharacterController>(); speedChange = GetComponent <SpeedChange>(); inventory = GetComponent <Opsive.ThirdPersonController.Wrappers.Inventory>(); if (flowchart == null && flowchartName != null && flowchartName.Trim().Length != 0) { flowchart = GameObject.Find("/Fungus/Flowcharts/" + flowchartName).GetComponent <Fungus.Flowchart>(); } trackEvent.AddListener(TrackTargetsInLayers); }