Page 423 - MDP2022-3
P. 423

IEnumerator  Wake()
                     {
                             audiosourece.Play();
                             yield  return  new  WaitForSeconds(2f);


                             for  (int  i  =  0;  i  <  100;  i++)
                             {


                                     transform.localScale  +=  new  Vector3(0f,  0f,  0.015f);
                                     transform.position  +=  (new  Vector3(0f,  0f,  0.004f));

                                     yield  return  null;


                             }


                             animator.avatar  =  avatar;
                             animator.SetBool("isWalk",  true);
                             navAgent.isStopped  =  false;
                             awakeSuccess  =  true;


                     }


                     private  void  Awake()
                     {
                             animator  =  GetComponent<Animator>();
                             audiosourece  =  GetComponent<AudioSource>();
                             navAgent  =  GetComponent<NavMeshAgent>();
                             rigid  =  GetComponent<Rigidbody>();
                             navAgent.isStopped  =  true;
                     }


                     float  stun_Timer  =  0;
                     public  float  stunTime  =  3;
                     public  bool  stun  =  false;


                     void  freezevelocity()
                     {
                             rigid.velocity  =  Vector3.zero;
                             rigid.angularVelocity  =  Vector3.zero;
                     }




            타로  시뮬레이터
   418   419   420   421   422   423   424   425   426   427   428