void Awake() { hero = GameObject.FindObjectOfType <ScoutHero>(); rBody = hero.gameObject.GetComponent <Rigidbody>(); collider = hero.GetComponent <CapsuleCollider>(); heroScript = hero.gameObject.GetComponent <Hero>(); }
void Start() { hero = GameObject.FindObjectOfType <ScoutHero>(); heroRenderer = hero.gameObject.transform.FindChild("Body_01").GetComponent <Renderer>(); // aiEntity = hero.GetComponentInChildren<EntityRig>(); inactiveSkillMaterial = heroRenderer.material; activeSkillMaterial = new Material(Shader.Find("Projector/Light")); }
void Update() { if (InputManager.Fire1() && !InputManager.Shift()) { SelectHero(); } if (InputManager.TabUp()) { NextHero(); } if (InputManager.Fire2()) { GetDistinationPosition(); } if (InputManager.Space()) { SetHeroOrientation(); if (_curHero is ScoutHero) { ScoutHero scout = _curHero as ScoutHero; scout.TargetingMode(true); } if (InputManager.Fire1()) { HeroMustShoot(); } } if (InputManager.SpaceUp()) { if (_curHero is ScoutHero) { ScoutHero scout = _curHero as ScoutHero; scout.TargetingMode(false); } } if (InputManager.Follow()) { SetUpCameraMode(); } if (InputManager.UseUp()) { _curHero.TryToInteract(); } if (InputManager.ControlUp()) { if (_curHero is ScoutHero) { ScoutHero scout = _curHero as ScoutHero; scout.DuckModeToggle(); } } if (InputManager.ShiftUp()) { if (_curHero is ScoutHero) { ScoutHero scout = _curHero as ScoutHero; scout.ScoutRunToggle(); } } }