Exemplo n.º 1
0
    public void SetPowerSpeed(GlobalDefine.CarMovementDir _carDir)
    {
        bool bProcess = false;

        if (m_dir == _carDir)
        {
            bProcess = true;
        }
        else
        {
            if ((m_dir == GlobalDefine.CarMovementDir.CarMovementDir_South || m_dir == GlobalDefine.CarMovementDir.CarMovementDir_North) &&
                (_carDir == GlobalDefine.CarMovementDir.CarMovementDir_South || _carDir == GlobalDefine.CarMovementDir.CarMovementDir_North))
            {
                bProcess = true;
            }
            else if ((m_dir == GlobalDefine.CarMovementDir.CarMovementDir_East || m_dir == GlobalDefine.CarMovementDir.CarMovementDir_West) &&
                     (_carDir == GlobalDefine.CarMovementDir.CarMovementDir_East || _carDir == GlobalDefine.CarMovementDir.CarMovementDir_West))
            {
                bProcess = true;
            }
        }
        if (bProcess == true)
        {
            m_bPower    = true;
            m_fCurSpeed = CarSpeedInf.PowerSpeed;
            m_fCurTime  = 0.0f;
        }
    }
Exemplo n.º 2
0
 public void ExecuteSpeed(GlobalDefine.CarMovementDir _carDir)
 {
     if (m_actChangeSpeed != null)
     {
         m_actChangeSpeed.Invoke(_carDir);
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     m_defaultDir = GlobalDefine.CarMovementDir.CarMovementDir_East;
     m_lstDirSets = new List <DirSets>();
     m_lstDirSets.Add(new DirSets(GlobalDefine.CarMovementDir.CarMovementDir_North, GlobalDefine.CarMovementDir.CarMovementDir_East, GlobalDefine.CarMovementDir.CarMovementDir_West));
     m_lstDirSets.Add(new DirSets(GlobalDefine.CarMovementDir.CarMovementDir_South, GlobalDefine.CarMovementDir.CarMovementDir_West, GlobalDefine.CarMovementDir.CarMovementDir_East));
     m_lstDirSets.Add(new DirSets(GlobalDefine.CarMovementDir.CarMovementDir_East, GlobalDefine.CarMovementDir.CarMovementDir_South, GlobalDefine.CarMovementDir.CarMovementDir_North));
     m_lstDirSets.Add(new DirSets(GlobalDefine.CarMovementDir.CarMovementDir_West, GlobalDefine.CarMovementDir.CarMovementDir_North, GlobalDefine.CarMovementDir.CarMovementDir_South));
 }
Exemplo n.º 4
0
 public void GenerateByDir(GlobalDefine.CarMovementDir _dir, GameObject _obj)
 {
     if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_North)
     {
         _generate(NorthPos, PrefabCar);
     }
     else if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_South)
     {
         _generate(SouthPos, PrefabCar);
     }
     else if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_East)
     {
         _generate(EastPos, PrefabCar);
     }
     else if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_West)
     {
         _generate(WestPos, PrefabCar);
     }
 }
 private void _changeSelfDir(GlobalDefine.PlayerDir _dir)
 {
     foreach (DirSets _set in m_lstDirSets)
     {
         if (m_defaultDir == _set.CheckDir)
         {
             if (_dir == GlobalDefine.PlayerDir.PlayerDir_Right)
             {
                 m_defaultDir = _set.RightDir;
                 break;
             }
             else if (_dir == GlobalDefine.PlayerDir.PlayerDir_Left)
             {
                 m_defaultDir = _set.LeftDir;
                 break;
             }
         }
     }
 }
Exemplo n.º 6
0
    public void SetStartData(Vector3 vecPos, GlobalDefine.CarMovementDir _dir)
    {
        m_dir = _dir;

        if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_East)
        {
            transform.Rotate(0, 180, 0);
        }
        else if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_North)
        {
            transform.Rotate(0, 90, 0);
        }
        else if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_South)
        {
            transform.Rotate(0, 270, 0);
        }
        else if (_dir == GlobalDefine.CarMovementDir.CarMovementDir_West)
        {
            transform.Rotate(0, 0, 0);
        }
    }
Exemplo n.º 7
0
 public RequestChangeSpeed(GlobalDefine.CarMovementDir _dir)
 {
     m_Typ = RequestCommand_Type.RequestCommand_Type_ChangeSpeed;
     m_dir = _dir;
 }
 public DirSets(GlobalDefine.CarMovementDir _checkDir, GlobalDefine.CarMovementDir _rightDir, GlobalDefine.CarMovementDir _leftDir)
 {
     CheckDir = _checkDir;
     RightDir = _rightDir;
     LeftDir  = _leftDir;
 }