void Update() { if (Terminal.GetQttHeroesInside() > 0) { heroFast.changeHeroAllowed = false; heroStrong.changeHeroAllowed = false; if (active) { if (Input.GetKeyDown(KeyCode.E)) { action = !action; } if (Input.GetButtonDown("ChangeHero")) { active = false; heroStrong.GetComponent <HeroControl>().enabled = true; heroFast.GetComponent <HeroControl>().enabled = true; if (activeHero) { activeHero.m_isActive = true; } else { heroStrong.m_isActive = true; } if (cameraControl.interactiveFocusableObject) { cameraControl.interactiveFocusableObject = null; } } } else { if (Input.GetButtonDown("ChangeHero")) { activeHero = GetActiveHero(); heroFast.m_isActive = false; heroStrong.m_isActive = false; heroFast.GetComponent <HeroControl>().enabled = false; heroStrong.GetComponent <HeroControl>().enabled = false; cameraControl.interactiveFocusableObject = clawPerSe.gameObject; active = true; activeHero.StopWalk(); } } } else { heroFast.changeHeroAllowed = true; heroStrong.changeHeroAllowed = true; } }
public override void Activate() { Terminal.GetComponent <Renderer>().enabled = true; GetComponent <Renderer>().enabled = true; GetComponentInChildren <SpriteRenderer>().enabled = true; puzzleController.SelectionBox1.GetComponent <Renderer>().enabled = true; puzzleController.SelectionBox2.GetComponent <Renderer>().enabled = true; puzzleController.cursor.GetComponent <Renderer>().enabled = true; heroStrong.GetComponent <HeroControl>().enabled = false; heroFast.GetComponent <HeroControl>().enabled = false; heroStrong.StopWalk(); heroFast.StopWalk(); puzzleController.setControlActive(); this.isActive = true; }
void Start() { instance = this; heroStrong = FindObjectOfType <HeroStrong>(); heroFast = FindObjectOfType <HeroFast>(); heroStrongControl = heroStrong.GetComponent <HeroControl>(); heroFastControl = heroFast.GetComponent <HeroControl>(); }
void Awake () { controller = GetComponentInParent<ClawController>(); coll = GetComponent<Collider2D>(); clawInitialPos = coll.bounds.center; heroStrong = FindObjectOfType<HeroStrong> (); heroFast = FindObjectOfType<HeroFast> (); heroStrongRigidBody = heroStrong.GetComponent<Rigidbody2D>(); heroFastRigidBody = heroFast.GetComponent<Rigidbody2D>(); }
void Awake() { controller = GetComponentInParent <ClawController>(); coll = GetComponent <Collider2D>(); clawInitialPos = coll.bounds.center; heroStrong = FindObjectOfType <HeroStrong> (); heroFast = FindObjectOfType <HeroFast> (); heroStrongRigidBody = heroStrong.GetComponent <Rigidbody2D>(); heroFastRigidBody = heroFast.GetComponent <Rigidbody2D>(); }
public void Start() { rigidBodyHeroStrong = heroStrong.GetComponent <Rigidbody2D>(); rigidBodyHeroFast = heroFast.GetComponent <Rigidbody2D>(); }
public void DisableControl() { heroStrong.GetComponent <HeroControl> ().enabled = false; heroFast.GetComponent <HeroControl> ().enabled = false; }