Page 395 - MDP2022-3
P. 395

제  3  장  타로게임  소프트웨어





            1)타로  카드


            (1)코드


                             if  (particled)
                             {
                                     if  (time  >  0)
                                     {
                                             time  -=  Time.deltaTime;
                                     }
                                     else
                                     {
                                             particle.SetActive(false);
                                             if  (!opened)
                                             {
                                                     if  (!sound)
                                                     {
                                                             audio.Play();
                                                             sound  =  true;
                                                     }
                                                     card  =  Random.Range(0,  cards.Length);
                                                     button.SetActive(true);
                                                     Ray.SetActive(true);
                                                     Ray2.SetActive(true);
                                                     cards[card].SetActive(true);
                                                     background1.SetActive(true);
                                                     text1[card].SetActive(true);
                                                     opened  =  true;
                                                     particled  =  false;
                                                     GameManager.instance.cardopen  =  true;
                                             }
                                     }
                             }
                     private  void  OnTriggerEnter(Collider  other)
                     {
                             if(other.name==  "stick")
                             {
                                     Debug.Log("asdasd");
                                     particled  =  true;
                                     audio.Play();
                                     particles.SetActive(true);

            ㅓㅓ             }
                     }
   390   391   392   393   394   395   396   397   398   399   400