예제 #1
0
 private void DestrtoyPlatform()
 {
     mc.enabled = false;
     platformFull.DestroyPlatform();
     //Instantiate(desctroyParticle);
     Destroy(transform.parent.gameObject, 0.5f);
 }
예제 #2
0
    public IEnumerator ActivateFullBonus()
    {
        for (int i = 0; i < 6; i++)
        {
            RaycastHit hit;

            if (Physics.Raycast(transform.position, -Vector3.up, out hit, 5f))
            {
                pr = hit.transform.gameObject.GetComponentInParent <PlatformRandomRotate>();
                Instantiate(destroyPartical, pr.transform.position, Quaternion.identity);
                audioManager.PlaySound(touchSound[0]);
                pr.DestroyPlatform();
                rb.velocity = new Vector3(0, -5, 0);
                bonus++;
                CheckScore();
                isActivate = false;

                //pr = hit.transform.gameObject.GetComponent<PlatformRandomRotate>();
            }
            yield return(new WaitForSeconds(0.1f));
        }
    }