public void Init() { mArchievementSystem = new ArchievementSystem(); mCampSystem = new CampSystem(); mCharacterSystem = new CharacterSystem(); mEnergySystem = new EnergySystem(); mGameEventSystem = new GameEventSystem(); mStageSystem = new StageSystem(); mCampInfoUI = new CampInfoUI(); mGamePauseUI = new GamePauseUI(); mGameStateInfoUI = new GameStateInfoUI(); mSoldierInfoUI = new SoldierInfoUI(); mArchievementSystem.Init(); mCampSystem.Init(); mCharacterSystem.Init(); mEnergySystem.Init(); mGameEventSystem.Init(); mStageSystem.Init(); mCampInfoUI.Init(); mGamePauseUI.Init(); mGameStateInfoUI.Init(); mSoldierInfoUI.Init(); LoadMemento(); }
//最好先Awake, 再Init. Awake中初始化数据, Init中再new对象之类的 //不然部分new对象比较分散的,就不好给System初始化进行排序,有耦合。比如EventSubject public void Init() { m_AchievementSystem = new AchievementSystem(); m_CampSystem = new CampSystem(); m_CharactorSystem = new CharacterSystem(); m_EnergySystem = new EnergySystem(); m_GameEventSystem = new GameEventSystem(); m_StageSystem = new StageSystem(); m_FileDataSystem = new FileDataSystem(); m_CampInfoUI = new CampInfoUI(); m_GamePauseUI = new GamePauseUI(); m_GameStateInfoUI = new GameStateInfoUI(); m_SolderInfoUI = new SoldierInfoUI(); m_FileDataSystem.Init(); m_AchievementSystem.Init(); m_CampSystem.Init(); m_CharactorSystem.Init(); m_EnergySystem.Init(); m_GameEventSystem.Init(); m_StageSystem.Init(); m_CampInfoUI.Init(); m_GamePauseUI.Init(); m_GameStateInfoUI.Init(); m_SolderInfoUI.Init(); LoadMemento(); }
private SoldierInfoUI m_SoldierInfoUI; //战士信息 public void Init() { m_ArchievementSystem = new ArchievementSystem(); m_CampSystem = new CampSystem(); m_CharacterSystem = new CharacterSystem(); m_EnergySystem = new EnergySystem(); m_GameEventSystem = new GameEventSystem(); m_StageSystem = new StageSystem(); m_CampInfoUI = new CampInfoUI(); m_GamePauseUI = new GamePauseUI(); m_GameStateInfoUI = new GameStateInfoUI(); m_SoldierInfoUI = new SoldierInfoUI(); m_ArchievementSystem.Init(); m_CampSystem.Init(); m_CharacterSystem.Init(); m_EnergySystem.Init(); m_GameEventSystem.Init(); m_StageSystem.Init(); m_CampInfoUI.Init(); m_GamePauseUI.Init(); m_GameStateInfoUI.Init(); m_SoldierInfoUI.Init(); }
public void Init() { systems = new List <IGameSystem>(); achievementSystem = new AchievementSystem(); campSystem = new CampSystem(); CharacterSystem = new CharacterSystem(); EnergySystem = new EnergySystem(); EventSystem = new GameEventSystem(); StageSystem = new StageSystem(); CampInfoUI = new CampInfoUI(); gamePauseUI = new GamePauseUI(); GameStateInfoUI = new GameStateInfoUI(); soldierInfoUI = new SoldierInfoUI(); systems.Add(achievementSystem); systems.Add(campSystem); systems.Add(CharacterSystem); systems.Add(EnergySystem); systems.Add(EventSystem); systems.Add(StageSystem); systems.Add(CampInfoUI); systems.Add(gamePauseUI); systems.Add(GameStateInfoUI); systems.Add(soldierInfoUI); systems.ForEach(s => s.Init()); var memento = CareTaker.RetrieveMemento(); //取回备忘录 achievementSystem.RestoreMemento(memento); //根据备忘录,恢复成就系统 }
private void Awake() { characterController = GetComponent <CharacterController>(); animator = GetComponent <Animator>(); hunger = GetComponent <HungerSystem>(); healthsystem = GetComponent <HealthSystem>(); energySystem = GetComponent <EnergySystem>(); }
void Start() { energySystem = this.GetComponent <EnergySystem>(); actions = this.GetComponent <PlayerActions>(); animations = this.GetComponent <PlayerAnimations>(); spells = this.GetComponent <PlayerSpells>(); spellsSystem = this.GetComponent <SpellsSystem>(); }
// Use this for initialization void Start() { this.energySystem = new EnergySystem(); initalizeNodes(); initalizeConnections(); nodes[0, 0].setEnergy(100f); }
public void OnUpdate() { ArchievementSystem.OnUpdate(); CampSystem.OnUpdate(); CharacterSystem.OnUpdate(); EnergySystem.OnUpdate(); GameEventSystem.OnUpdate(); StageSystem.OnUpdate(); UISystem.OnUpdate(); }
//Holder for Buff Selection so UI can have it private void OnEnable() { instance = this; inventory = new ModInventory(); //This will usually be level 1, but left open in case we do saves or //multiple levels where the player starts at a higher power tier. for (int i = 1; i < curEnergyTier; i++) { inventory.EquipNextMod(i); } }
void Start() { anim = GetComponent <Animator>(); navmesh = GetComponent <NavMeshAgent>(); healthsystem = GetComponent <HealthSystem>(); Enemycollider = GetComponent <Collider>(); BodyColliderDeath.enabled = false; energySystem = GetComponent <EnergySystem>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); punch.enabled = false; }
public void OnRelease() { this.CreateMemento(); ArchievementSystem.OnRelease(); CampSystem.OnRelease(); CharacterSystem.OnRelease(); EnergySystem.OnRelease(); GameEventSystem.OnRelease(); StageSystem.OnRelease(); UISystem.OnRelease(); }
void Start() { energySystem = this.GetComponent <EnergySystem>(); actions = this.GetComponent <PlayerActions>(); animations = this.GetComponent <PlayerAnimations>(); spells = this.GetComponent <PlayerSpells>(); spellsSystem = this.GetComponent <SpellsSystem>(); //InitializeSkill(); //InitSpellsSystem(); //spells.SetSpells(HandType.Left, spellsSystem.spellsList[0]); //spells.SetSpells(HandType.Right, spellsSystem.spellsList[1]); }
void RpcResetRacers() { _raceStarted = true; int i = 1; foreach (KeyValuePair <GameObject, int> racer in _racers) { racer.Key.transform.position = transform.position + (transform.forward * 3 * i); racer.Key.transform.LookAt(transform); Vector3 p = racer.Key.transform.position; racer.Key.transform.position = new Vector3(p.x, 0.13f, p.z); EnergySystem engine = racer.Key.GetComponent <EnergySystem>(); engine.RestartEngine(); engine.IsLocked = true; ++i; } }
public static Vehicle GetNewCar( ref Client i_Owner, Vehicle.VehicleType i_VehicleType, string i_VehicleModel, string i_VehicleLicenseNumber, ref EnergySystem i_VehicleEnergySystem, short i_WheelsNumber, ref List <Wheel> i_VehicleWheels) { additionalCarInformationLabel(); return(CreateNewVehicle.CreateNewCar( ref i_Owner, i_VehicleType, i_VehicleModel, i_VehicleLicenseNumber, ref i_VehicleEnergySystem, i_WheelsNumber, ref i_VehicleWheels, getCarColor(), getCarDoors())); }
public static Vehicle GetNewMotorcycle( ref Client i_Owner, Vehicle.VehicleType i_VehicleType, string i_VehicleModel, string i_VehicleLicenseNumber, ref EnergySystem i_VehicleEnergySystem, short i_WheelsNumber, ref List <Wheel> i_VehicleWheels) { additionalMotorcycleInformationLabel(); return(CreateNewVehicle.CreateNewMotorcycle( ref i_Owner, i_VehicleType, i_VehicleModel, i_VehicleLicenseNumber, ref i_VehicleEnergySystem, i_WheelsNumber, ref i_VehicleWheels, getEngineCapacity(), getLicenseType())); }
public static Vehicle GetNewTruck( ref Client i_Owner, Vehicle.VehicleType i_VehicleType, string i_VehicleModel, string i_VehicleLicenseNumber, ref EnergySystem i_VehicleEnergySystem, short i_WheelsNumber, ref List <Wheel> i_VehicleWheels) { additionalTruckInformationLabel(); return(CreateNewVehicle.CreatNewTruck( ref i_Owner, i_VehicleType, i_VehicleModel, i_VehicleLicenseNumber, ref i_VehicleEnergySystem, i_WheelsNumber, ref i_VehicleWheels, getcargoVolume(), cargoDangerousMaterials())); }
public void AddRacer(GameObject racer) { if (_raceStarted) { Destroy(racer); Debug.Log("A racer tried to register while the race has already started"); return; } racer.transform.position = transform.position + (transform.forward * 3 * (_racers.Count + 1)); racer.transform.LookAt(transform); Vector3 p = racer.transform.position; racer.transform.position = new Vector3(p.x, 0.13f, p.z); EnergySystem engine = racer.GetComponent <EnergySystem>(); engine.SetupColor(Colours[_racers.Count % Colours.Length]); engine.IsLocked = true; _racers.Add(racer, 0); }
// Use this for initialization void Awake() { // PlayerPrefs.DeleteAll (); if (!instance) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } energy = PlayerPrefs.GetInt("Energy", maxEnergy); //get energy from prefs,if first start - get default(max) //get the energy from the prefs if the first start is taken by default (maximum energy) // StartCoroutine(Check()); //delete this line if u do not wont check time periodically //Если мы не хотим проверять время переодически то эту строку надо убрать coin = PlayerPrefs.GetInt("Coin", 0); // nextE = nextTime; }
public GameFacade OnInit() { UISystem = new UISystem(); ArchievementSystem = new ArchievementSystem(); CampSystem = new CampSystem(); CharacterSystem = new CharacterSystem(); EnergySystem = new EnergySystem(); GameEventSystem = new GameEventSystem(); StageSystem = new StageSystem(); UISystem.OnInit(); CampSystem.OnInit(); CharacterSystem.OnInit(); EnergySystem.OnInit(); GameEventSystem.OnInit(); StageSystem.OnInit(); ArchievementSystem.OnInit(); this.LoadMemento(); return(this); }
private void Awake() { playerMovement = GetComponent <PlayerMovement>(); energySystem = GetComponent <EnergySystem>(); }
public static Vehicle GetNewVehicle(ref Client i_Client, ref Garage i_Garage) { Vehicle newVehicle = null; generalVehicleDetailsLabel(); string vehicleLicenseNumber = GetVehicleLicenseNumber(); if (i_Garage.IsVehicleFoundInGarage(vehicleLicenseNumber)) { Folder folder; i_Garage.GarageDataBase.TryGetValue(vehicleLicenseNumber, out folder); folder.FolderSubject.Status = Vehicle.VehicleStatus.InRepair; Console.WriteLine("Vehicle License Number {0} Existing In Garage", vehicleLicenseNumber); Console.WriteLine("Vehicle Status Chaned to {0}", Vehicle.VehicleStatus.InRepair); } else { vehicleTypeLabel(); vehicleTypesInstructionMessage(); Vehicle.VehicleType vehicleType = getVehicleType(); string vehicleModel = getVehicleModel(); short vehicleWheelsNumber = getVehicleWheelsNumber(vehicleType); EnergySystem vehicleEnergySystem = EnergySystemUI.GetNewEnergySystem(vehicleType); List <Wheel> vehicleWheels = getVehicleWheels(vehicleWheelsNumber, vehicleType); if (vehicleType == Vehicle.VehicleType.Car) { newVehicle = CarUI.GetNewCar( ref i_Client, vehicleType, vehicleModel, vehicleLicenseNumber, ref vehicleEnergySystem, vehicleWheelsNumber, ref vehicleWheels); } else if (vehicleType == Vehicle.VehicleType.Motorcycle) { newVehicle = MotorcycleUI.GetNewMotorcycle( ref i_Client, vehicleType, vehicleModel, vehicleLicenseNumber, ref vehicleEnergySystem, vehicleWheelsNumber, ref vehicleWheels); } else if (vehicleType == Vehicle.VehicleType.Truck) { newVehicle = TruckUI.GetNewTruck( ref i_Client, vehicleType, vehicleModel, vehicleLicenseNumber, ref vehicleEnergySystem, vehicleWheelsNumber, ref vehicleWheels); } else { Console.WriteLine("Bad Selection"); } } return(newVehicle); }