コード例 #1
0
ファイル: PetMove.cs プロジェクト: GMOM-RHIE/gesodogs_proto2
 void OnCollisionEnter(Collision collision)
 {
     if(LayerMask.LayerToName(collision.gameObject.layer) != "ground"){
         currentMotionState = motion_state.sit;
         startAnimation();
         transform.position -= transform.forward * Time.deltaTime*6;
         if (Debug.isDebugBuild)Debug.Log (collision.gameObject.name);
     }
 }
コード例 #2
0
ファイル: PetMove.cs プロジェクト: GMOM-RHIE/gesodogs_proto2
 public void changeMotionState(motion_state state)
 {
     currentMotionState = state;
     startAnimation();
 }
コード例 #3
0
ファイル: PetMove.cs プロジェクト: GMOM-RHIE/gesodogs_proto2
 /*}
   	}*/
 void changeMotionState()
 {
     int r = Random.Range(0,100);
     int c = 0;
     for (int i = 0; i < MOTION_CHANGE.GetLength(0); i++) {
         c+=MOTION_CHANGE[(int)currentMotionState,i];
         if (c >= r) {
             if (System.Enum.IsDefined(typeof(motion_state), i)) {
                 currentMotionState = (motion_state) i;
                 if (Debug.isDebugBuild)Debug.Log ("MOTIONSTATE:"+currentMotionState);
                 break;
             }
         }
     }
     //gameObject.animation.CrossFade(System.Enum.GetName(typeof(motion_state), currentMotionState));
     //	motionInterval = (float) Random.Range(DEFAULT_MOTION_INTERVAL-2.0f,DEFAULT_MOTION_INTERVAL+2.0f);
     startAnimation();
 }