private void Awake() { ac = GetComponent <AIController>(); movement = GetComponent <MovementController>(); sense = GetComponent <SenseController>(); unit = GetComponent <Unit>(); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { anim = animator; unitObject = animator.gameObject; unit = unitObject.GetComponent <Unit>(); characterAnimator = unitObject.GetComponent <CharacterAnimator>(); senseController = unitObject.GetComponent <SenseController>(); aIController = unitObject.GetComponent <AIController>(); fightController = unitObject.GetComponent <FightController>(); }
private void Awake() { characterAnimator = GetComponent <CharacterAnimator>(); unit = GetComponent <Unit>(); sense = GetComponent <SenseController>(); movement = GetComponent <MovementController>(); gather = GetComponent <GatherController>(); animator = GetComponent <Animator>(); }
private void SetSenseToCurrentSlot(SenseController.SenseType sense) { int otherSlot = (currentSlot == 1)? 0 : 1; if (activeSenses[currentSlot] == sense) { senseController.SetSenseEnabled(activeSenses[currentSlot], false); activeSenses[currentSlot] = SenseController.SenseType.None; } else if (activeSenses[otherSlot] != sense) { if (activeSenses[currentSlot] != SenseController.SenseType.None) { senseController.SetSenseEnabled(activeSenses[currentSlot], false); activeSenses[currentSlot] = SenseController.SenseType.None; } activeSenses[currentSlot] = sense; senseController.SetSenseEnabled(sense, true); } /*else { SenseController.SenseType tempSense = activeSenses[0]; activeSenses[0] = activeSenses[1]; activeSenses[1] = tempSense; }*/ }
public bool IsSenseActive(SenseController.SenseType sense) { return (activeSenses[0] == sense || activeSenses[1] == sense); }
// Use this for initialization void Start() { sightCamera = GameObject.Find("SightCamera"); hearingCamera = GameObject.Find("HearingCamera"); senseController = GetComponentInChildren<SenseController>(); activeSenses = new SenseController.SenseType[2]; activeSenses[0] = senseController.startWithNoSense? SenseController.SenseType.None : SenseController.SenseType.Sight; activeSenses[1] = SenseController.SenseType.None; currentSlot = 0; mouseLooks = GetComponentsInChildren<MouseLook>(); deathBoundOverride = new Dictionary<int, float>(); _cacheTransform = this.transform; // //deathBoundOverride.Add (); }
void Awake() { SightGO = transform.Find("SightCamera").gameObject; HearingGO = transform.Find("HearingCamera").gameObject; ScentGO = transform.Find("ScentCamera").gameObject; FeelingGO = transform.Find("FeelingCamera").gameObject; enabledSkybox = Resources.Load ("Materials/Materials/Skybox-invert", typeof(Material)) as Material; disabledSkybox = Resources.Load ("Materials/Materials/Skybox", typeof(Material)) as Material; SetSenseEnabled(SenseType.Sight, !startWithNoSense); SetSenseEnabled(SenseType.Hearing, false); SetSenseEnabled(SenseType.Feeling, false); SetSenseEnabled(SenseType.Scent, false); buttonHandler = transform.parent.GetComponent<ButtonHandler>(); _singleton = this; //Debug.Log ("ID: " + GetInstanceID()); }