示例#1
0
    void Throw()
    {
        m_audioSource.clip = ThrowAudio;
        m_audioSource.Play();
        GameObject throwMushroom = PickedMushrooms.Pop();

        if (!throwMushroom)
        {
            return;
        }
        throwMushroom.transform.SetParent(null, true);
        throwMushroom.transform.position = m_collider.bounds.center + transform.forward * 2;

        Mushroom mushScript = throwMushroom.GetComponent <Mushroom>();

        mushScript.playerThrew = true;
        mushScript.Throw(transform.forward);
        m_animator.SetTrigger("Throw");
    }