Exemple #1
0
    /// <summary>
    /// Shield Things
    /// </summary>

    /*void ShieldPush(){
     *      if (Input.GetButtonDown (xBut)) {
     *              StartCoroutine(shieldScript.PushAway());
     *      }
     * }
     */
    /// <summary>
    /// Hammer Things
    /// </summary>

    /*
     * void HammerSmack(){
     *      if (Input.GetButtonDown (xBut)) {
     *              StartCoroutine(hammerScript.Cocking(1));
     *      }
     * }
     *
     * void HammerSmash(){
     *      if (Input.GetButtonDown (bBut)) {
     *              StartCoroutine(hammerScript.Cocking(2));
     *      }
     * }*/

    /// <summary>
    /// Things you can always do when alive
    /// </summary>
    void ShieldGunSword()
    {
        if (Input.GetButtonDown(yBut))
        {
            StartCoroutine(armRotate.SwitchHands());
        }
    }
Exemple #2
0
    public IEnumerator Rebirth()
    {
        int rando = Random.Range(0, 6);

        if (!followP1)
        {
            transform.position = spawnSpots[rando];
        }
        else
        {
            transform.position = deathSpot;
        }
        transform.rotation = Quaternion.identity;

        locationFreeze = false;
        rigidbody2D.WakeUp();
        spriteHero.enabled                      = true;
        spriteArm.enabled                       = true;
        spriteShield.enabled                    = false;
        getDamage.enabled                       = true;
        weaponDetectorScript.occupied           = false;
        weaponDetectorScript.collider2D.enabled = true;
        controller.weaponState                  = 0;
        tractorBeamCol.enabled                  = true;
        crouching   = false;
        uncrouching = false;
        onMyKnees   = false;


        if (GetComponent <Unfreeze> ())
        {
            Component.Destroy(gameObject.GetComponent <Unfreeze> ());
        }

        cirCol.enabled = false;

        foreach (Collider2D col in polyCols)
        {
            col.enabled = false;
        }

        weaponCol.enabled = true;
        shieldCol.enabled = false;

        StartCoroutine(Unfreeze());
        StartCoroutine(ResetStand());


        rigidbody2D.fixedAngle   = true;
        rigidbody2D.gravityScale = 1f;
        currentHealth            = startingHealth;
        rigidbody2D.velocity     = new Vector2(0f, 0f);

        StartCoroutine(healthBar.RebirthHealth());

        alive = true;
        controller.weaponState = 2;
        StartCoroutine(armRotateScript.SwitchHands());
        if (zoomZone)
        {
            StartCoroutine(zoomZone.SetOldHeight());
        }
        yield return(null);
    }