コード例 #1
0
ファイル: FallingTrap.cs プロジェクト: whe0107/RollingBox-1
    IEnumerator Fall()
    {
        while (wf)
        {
            FallVelocity -= FallSpeed * Time.deltaTime * 60 * Global.TheWorld;
            rb.velocity   = new Vector2(0, FallVelocity * Global.TheWorld);
            if (transform.position.y < 0.95)
            {
                this.gameObject.tag = "Untagged";
                wf = false;
                if (Able_Destroy)
                {
                    StartCoroutine(Broke());
                }
                else
                {
                    SM.Play(Clip);
                    rb.velocity        = new Vector2(0, 0);
                    transform.position = new Vector2(transform.position.x, 0.35f);
                }
            }

            yield return(new WaitForFixedUpdate());
        }
    }
コード例 #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         SM.Play(Clip);
     }
 }
コード例 #3
0
    private IEnumerator startGameRoutine()
    {
        m_readyText.enabled = true;
        m_audioSource.Play(m_startAudio);
        yield return(new WaitForSeconds(m_startAudio.length));

        m_audioSource.PlayBackroundAudio();
        EventManager.TriggerEvent("startGame");
        m_readyText.enabled = false;
    }
コード例 #4
0
 void Poison()
 {
     Debug.Log("Poison");
     HpChange(2);
     SM.Play(DamagedSound);
 }