Beispiel #1
0
 public MyCharacterController getOffCoast(string passenger_name)                 // 0->priest, 1->devil
 {
     for (int i = 0; i < passengerPlaner.Length; i++)
     {
         if (passengerPlaner [i] != null && passengerPlaner [i].getName() == passenger_name)
         {
             MyCharacterController charactorCtrl = passengerPlaner [i];
             passengerPlaner [i] = null;
             return(charactorCtrl);
         }
     }
     Debug.Log("cant find passenger on coast: " + passenger_name);
     return(null);
 }
Beispiel #2
0
 public MyCharacterController GetOffBoat(string passenger_name)
 {
     for (int i = 0; i < passenger.Length; i++)
     {
         if (passenger [i] != null && passenger [i].getName() == passenger_name)
         {
             MyCharacterController charactorCtrl = passenger [i];
             passenger [i] = null;
             return(charactorCtrl);
         }
     }
     Debug.Log("Cant find passenger in boat: " + passenger_name);
     return(null);
 }
Beispiel #3
0
 //离岸函数
 public MyCharacterController getOffCoast(string name)
 {
     for (int i = 0; i < passenger.Length; i++)
     {
         if (passenger[i] != null && passenger[i].getName() == name)
         {
             if (passenger[i].getType() == true)
             {
                 Priests--;
             }
             else
             {
                 Devils--;
             }
             MyCharacterController mycharacter = passenger[i];
             passenger[i] = null;
             return(mycharacter);
         }
     }
     return(null);
 }
Beispiel #4
0
        public void moveCharacter(MyCharacterController characterCtrl, Vector3 destination)
        {
            Vector3 currentPos = characterCtrl.getPos();
            Vector3 middlePos  = currentPos;

            if (destination.y > currentPos.y)                           //from low(boat) to high(coast)
            {
                middlePos.y = destination.y;
            }
            else                        //from high(coast) to low(boat)
            {
                middlePos.x = destination.x;
            }
            ObjAction action1   = MoveToAction.getAction(middlePos, characterCtrl.movingSpeed);
            ObjAction action2   = MoveToAction.getAction(destination, characterCtrl.movingSpeed);
            ObjAction seqAction = SequenceAction.getAction(1, 0, new List <ObjAction> {
                action1, action2
            });

            this.addAction(characterCtrl.getGameobj(), seqAction, this);
        }
Beispiel #5
0
        public void GetOnBoat(MyCharacterController characterCtrl)
        {
            int index = getEmptyIndex();

            passenger [index] = characterCtrl;
        }
Beispiel #6
0
        public void getOnCoast(MyCharacterController characterCtrl)
        {
            int index = getEmptyIndex();

            passengerPlaner [index] = characterCtrl;
        }
Beispiel #7
0
 //上岸函数
 public void getOnCoast(MyCharacterController mycharacter)
 {
     passenger[getEmptyIndex()] = mycharacter;
 }
Beispiel #8
0
        public void getOnCoast(MyCharacterController _characterController)
        {
            int index = getEmptyIndex();

            characterOnCoast[index] = _characterController;
        }
Beispiel #9
0
 public void GetOnBoat(MyCharacterController _characterController)
 {
     passenger[getEmptyIndex()] = _characterController;
 }
Beispiel #10
0
        public void setCharacterCtrl(MyCharacterController characterCtrl)
        {
            int index = getEmptyIndex();

            characterOnCoast[index] = characterCtrl;
        }
Beispiel #11
0
 public void setCharacterOnBoat(MyCharacterController characterCtrl)
 {
     passenger[getEmptyIndex()] = characterCtrl;
 }