Esempio n. 1
0
        public void OnStateChange(Arch.Core.StateController _stateController)
        {
            switch (_stateController.CurrSubState)
            {
            case Arch.Core.SubStates.PregameInit:
                LoadGameData();
                break;

                /*case Arch.Core.SubStates.PregameLevelSet:
                 *  break;
                 * case Arch.Core.SubStates.PregameUiUpdate:
                 *  break;
                 * case Arch.Core.SubStates.PregameFinished:
                 *  break;
                 * case Arch.Core.SubStates.IngameInit:
                 *  break;
                 * case Arch.Core.SubStates.IngameFinished:
                 *  break;
                 * case Arch.Core.SubStates.PostInit:
                 *  break;
                 * case Arch.Core.SubStates.Result:
                 *  break;
                 * case Arch.Core.SubStates.PostFinished:
                 *  break;*/
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Spawns and return the CarBase model
        /// </summary>
        /// <returns></returns>
        public Management.Car.CarBase SpwanCar(Arch.Core.StateController _stateController, Management.Car.CarBase carInstanceFromPool = null, bool isFTUE = false)
        {
            #if CAR_DEBUG
            Management.Car.CarData carData = _stateController.CarDataScriptable.GetCarData(carDebugType);
            #else
            Management.Car.CarData carData = _stateController.CarDataScriptable.GetCarData(Car.CarType.NORMAL_CAR);
            #endif
            if (carData == null)
            {
                Debug.LogError("Car is not set in the scriptable");
                return(null);
            }
            Management.Car.CarBase carInstance = carInstanceFromPool;
            if (carInstance == null)
            {
                Management.Car.CarBase carBase = carData.GetRandomCar();
                if (carBase == null)
                {
                    Debug.LogError("Car base is not set in the scriptable");
                    return(null);
                }
                carInstance = Instantiate(carBase, transform) as Management.Car.CarBase;
            }

            Transform spawnPoint = null;
            if (isFTUE)
            {
                carInstance.Spawn_Point = Car.CarBase.SpawnPoint.FTUE_SPAWN_POINT;
                spawnPoint = spawnPoints[(int)Car.CarBase.SpawnPoint.FTUE_SPAWN_POINT];
            }
            else
            {
                int spawnPointIndex = GetRandomIndex(spawnPoints.Length);
                carInstance.Spawn_Point = (Management.Car.CarBase.SpawnPoint)spawnPointIndex;
                spawnPoint = spawnPoints[spawnPointIndex];
            }
            carInstance.transform.position = spawnPoint.position;
            carInstance.transform.rotation = spawnPoint.rotation;

            return(carInstance);
        }
Esempio n. 3
0
 public void Initilize(Arch.Core.StateController _stateController)
 {
 }