Page 364 - MDP2022-3
P. 364

GameManager.UpdateLifeIcon(life);
                                    GameManager.callExplosion(transform.position,  "P");
                                    player  =  false;
                                    if  (life  ==  0)

                                    {
                                            GameManager.gameOver();
                                    }
                                    else
                                    {

                                    GameManager.RespawnPlayer();
                                    gameObject.SetActive(false);
                                    }
                                    collision.gameObject.SetActive(false);


                            }else  if  (collision.gameObject.tag  ==  "Item")  //아이템과의  상호작용

                            {
                                    Item  item  =  collision.gameObject.GetComponent<Item>();
                                    switch  (item.Type)
                                    {

                                            case  "Coin":
                                                    score  +=  500;
                                                    break;
                                            case  "Power":
                                                            power++;


                                                    if(power>3)
                                                    {
                                                            addFollower();
                                                    }

                                                    break;
                                            case  "Boom":
                                                    if  (boom  <  3)
                                                    {
                                                            boom++;
                                                            GameManager.UpdateBoomIcon(boom);

                                                    }
                                                    else
                                                    {
                                                            score  +=  300;

                                                    }
                                                    break;
   359   360   361   362   363   364   365   366   367   368   369