예제 #1
0
    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;
        }
    }
예제 #2
0
 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;
 }
예제 #3
0
 void Start()
 {
     instance          = this;
     heroStrong        = FindObjectOfType <HeroStrong>();
     heroFast          = FindObjectOfType <HeroFast>();
     heroStrongControl = heroStrong.GetComponent <HeroControl>();
     heroFastControl   = heroFast.GetComponent <HeroControl>();
 }
예제 #4
0
 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>();
 }
예제 #5
0
 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>();
 }
예제 #6
0
 public void Start()
 {
     rigidBodyHeroStrong = heroStrong.GetComponent <Rigidbody2D>();
     rigidBodyHeroFast   = heroFast.GetComponent <Rigidbody2D>();
 }
예제 #7
0
 public void DisableControl()
 {
     heroStrong.GetComponent <HeroControl> ().enabled = false;
     heroFast.GetComponent <HeroControl> ().enabled   = false;
 }