public void Awake() { _name = "PROLogicX"; _level = 1; playerClass = PlayerClass.Warrior; playerState = PlayerState.Normal; _exp = 0; _levelModifier = 1.05f; _expToLevel = 100; _alive = true; _waitingToExitCombat = false; _canFight = true; _attributes = new Attribute[Enum.GetValues(typeof(AttributeName)).Length]; _vitals = new Vital[Enum.GetValues(typeof(VitalName)).Length]; if (globalPrefabs == null) { globalPrefabs = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GlobalPrefabs>(); } SetupStats(); SetupVitals(); }
private void CreateSceneItemsList() { foreach (DeserializedLevels.Item deserializedItem in GetCurrentLevel().items) { string prefabName = deserializedItem.prefab; // if the prefab in the item XmlNode has not been loaded then add it to the prefabPool if (!prefabPool.ContainsKey(prefabName)) { GameObject prefabObject = GlobalPrefabs.GetPrefab(prefabName); if (prefabObject == null) { // If we couldn't find the object, break out and continue the loop continue; } prefabPool.Add(prefabName, prefabObject); } ItemStruct item = new ItemStruct(prefabPool[prefabName], deserializedItem); sceneItemsList.Add(item); } }
// Use this for initialization void Start() { playerNew = GetComponent <PlayerNew>(); if (globalPrefabs == null) { globalPrefabs = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GlobalPrefabs>(); } startRespawn = true; //Will start respawn if needed }
void Start() { if (_pc == null) { _pc = GetComponent <PlayerNew>(); } if (globalPrefabs == null) { globalPrefabs = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GlobalPrefabs>(); } }
void Start() { GlobalPrefabs.LoadAll("Characters"); GlobalPrefabs.LoadAll("Environment"); GlobalPrefabs.LoadAll("Game Dynamics"); DeserializedLevelsLoader deserializedLevelsLoader = new DeserializedLevelsLoader(); deserializedLevelsLoader.GenerateItems(); DontDestroyOnLoad(this); }
void Start() { if (player == null) { player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerNew>(); } if (globalPrefabs == null) { globalPrefabs = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GlobalPrefabs>(); } OriginalAttacksPerSecond = AttacksPerSecond; }
// Use this for initialization void Start() { mainGame = GameLogicGameObject.GetComponent<WeedGame>(); globalPrefabs = GameLogicGameObject.GetComponent<GlobalPrefabs>(); }
// Use this for initialization void Start() { stationedTrucks = new Truck[maxTruckAmount]; globalPrefabs = GameObject.FindGameObjectWithTag("GameLogic").GetComponent<GlobalPrefabs>(); }