Beispiel #1
0
    IEnumerator Dash()
    {
        // Start of Dash
        b.PlaySound(2, 0.7f);
        rb.velocity = rb.velocity * dashMultiplier;
        b.DisablePlayerInfluence();
        yield return(new WaitForSeconds(dashTime));

        b.EnablePlayerInfluence();
    }
Beispiel #2
0
    public void FreezeGameState()
    {
        //Disable Pieces
        p1.DisableBeybladePieces();
        p2.DisableBeybladePieces();

        //Disable Controls
        p1.DisablePlayerInfluence();
        p2.DisablePlayerInfluence();

        //Set Velocity to 0
        p1.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;
        p2.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;
    }
Beispiel #3
0
    IEnumerator FreezeFrame2D(Beyblade attacker, Beyblade defender, int comboCount, float clashSpeed)
    {
        //Freeze physics
        attacker.GetComponentInChildren <MovementControls>().enabled = false;
        attacker.GetComponentInChildren <TiltControls>().enabled     = false;

        defender.GetComponentInChildren <MovementControls>().enabled = false;
        defender.GetComponentInChildren <TiltControls>().enabled     = false;

        Vector3 a_velo = attacker.GetComponentInChildren <Rigidbody>().velocity;
        Vector3 d_velo = defender.GetComponentInChildren <Rigidbody>().velocity;

        //Set Velocity to 0
        attacker.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;
        defender.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;

        //Initialize
        m_cevent.SetPlayers(attacker.GetComponent <ClashEventModule>(), defender.GetComponent <ClashEventModule>());
        attacker.GetComponent <ClashEventModule>().enabled = true;
        defender.GetComponent <ClashEventModule>().enabled = true;

        //Disable Pieces
        attacker.DisableBeybladePieces();
        defender.DisableBeybladePieces();

        //Focused Camera
        m_cam.FocusMyCam(attacker.gameObject);

        yield return(new WaitForSeconds(m_delayTransition / 2));

        attacker.BounceBack(defender, a_velo - d_velo);
        yield return(new WaitForSeconds(m_delayTransition / 2));

        //Set Velocity to 0
        attacker.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;
        defender.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;

        //Unfreeze physics
        attacker.GetComponentInChildren <MovementControls>().enabled = true;
        attacker.GetComponentInChildren <TiltControls>().enabled     = true;

        defender.GetComponentInChildren <MovementControls>().enabled = true;
        defender.GetComponentInChildren <TiltControls>().enabled     = true;

        //Disable Controls
        attacker.DisablePlayerInfluence();
        defender.DisablePlayerInfluence();

        //Designate Combo Count
        m_cevent.SetMaxCombo(comboCount);

        //Enable Shield
        defender.GetComponent <ShieldController>().enabled = true;

        //Set the Clash Speed
        if (clashSpeed > 0f)
        {
            m_cevent.SetAttackDuration(clashSpeed);
        }

        //Start the event
        m_cevent.enabled = true;
    }