Ejemplo n.º 1
0
    void SwitchRoad(sc_character _char, RoadInfo targetRoad)
    {
        int     originSort = _char.GetNowSortOrder();
        Vector3 tmpVec;

        tmpVec   = _char.transform.position;
        tmpVec.z = targetRoad.zValue;
        _char.transform.position = tmpVec;
        _char.SetSortingOrder(originSort % 10 + targetRoad.spriteSort, false);
    }
Ejemplo n.º 2
0
 public void DoStairsSwitch(sc_character _char, float _spd)
 {
     if (_spd > 0.0001f && SwitchDirection == Direction.Right || _spd < 0.0001f && SwitchDirection == Direction.Left)
     {
         if (_char.Up && !_char.Down)
         {
             SwitchRoad(_char, MySwitchRoads [1]);
         }
         else if (_char.Down && !_char.Up)
         {
             SwitchRoad(_char, MySwitchRoads [2]);
         }
         else
         {
             SwitchRoad(_char, MySwitchRoads [0]);
         }
     }
     else
     {
         SwitchRoad(_char, OriginRoad);
     }
 }