public static bool Prefix(ref SubRoot __instance) { UpgradeManager upgradeMgr = CyclopsManager.GetUpgradeManager(__instance); if (upgradeMgr == null) { return(true); } CrushDamage crushDmg = __instance.gameObject.GetComponent <CrushDamage>(); if (crushDmg == null) { return(true); } float orignialCrushDepth = crushDmg.crushDepth; crushDmg.SetExtraCrushDepth(upgradeMgr.BonusCrushDepth); if (orignialCrushDepth != crushDmg.crushDepth) { ErrorMessage.AddMessage(Language.main.GetFormat("CrushDepthNow", crushDmg.crushDepth)); } return(false); // Completely override the method and do not continue with original execution // The original method execution sucked anyways :P }
private void OnEnable() { clickText.SetActive(true); uManager = GameObject.FindGameObjectWithTag("UpgradeManager").GetComponent <UpgradeManager>(); gManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); if (uManager.nivelBarco == 1) { this.GetComponent <Image>().sprite = barcoBatalhaUm; bulletSpeed = 5; cooldownTime = 2f; } if (uManager.nivelBarco == 2) { this.GetComponent <Image>().sprite = barcoBatalhaDois; bulletSpeed = 6; cooldownTime = 1.5f; } if (uManager.nivelBarco == 3) { this.GetComponent <Image>().sprite = barcoBatalhaTres; bulletSpeed = 7; cooldownTime = 1f; } }
void Awake() { if (!plant) { Debug.LogError("No coffee plant set!"); } if (!cMaker) { Debug.LogError("No coffee maker set!"); } if (!register) { Debug.LogError("No register set!"); } if (!farmerManager) { Debug.LogError("No Farmers object set!"); } if (!baristaManager) { Debug.LogError("No Baristas object set!"); } if (!instance) { instance = this; } else if (instance != this) { Destroy(this); } }
private void LoadStartup() { SV_UPGRADE_CAPACITY_BEER = PlayerPrefs.GetInt(SV_UPGRADE_CAPACITY_BEER_KEY, 1); SV_UPGRADE_CAPACITY_WINE = PlayerPrefs.GetInt(SV_UPGRADE_CAPACITY_WINE_KEY, 1); SV_UPGRADE_CAPACITY_JUICE = PlayerPrefs.GetInt(SV_UPGRADE_CAPACITY_JUICE_KEY, 1); SV_UPGRADE_LIFE = PlayerPrefs.GetInt(SV_UPGRADE_LIFE_KEY, 0); SV_UPGRADE_GRAVITY_BEER = PlayerPrefs.GetInt(SV_UPGRADE_GRAVITY_BEER_KEY, 1); UpgradeManager.GetInstance().UPGRADE_BEER_GRAVITY = (SV_UPGRADE_GRAVITY_BEER + 1f) / 2f; SV_UPGRADE_GRAVITY_WINE = PlayerPrefs.GetInt(SV_UPGRADE_GRAVITY_WINE_KEY, 1); UpgradeManager.GetInstance().UPGRADE_WINE_GRAVITY = (SV_UPGRADE_GRAVITY_WINE + 1f) / 2f; SV_UPGRADE_GRAVITY_JUICE = PlayerPrefs.GetInt(SV_UPGRADE_GRAVITY_JUICE_KEY, 1); UpgradeManager.GetInstance().UPGRADE_JUICE_GRAVITY = (SV_UPGRADE_GRAVITY_JUICE + 1f) / 2f; SV_UPGRADE_TIER = PlayerPrefs.GetInt(SV_UPGRADE_TIER_KEY, 0); SV_UPGRADE_BONUS_PIPES = PlayerPrefs.GetInt(SV_UPGRADE_BONUS_PIPES_KEY, 0); SV_UPGRADE_BONUS_DRINKS = PlayerPrefs.GetInt(SV_UPGRADE_BONUS_DRINKS_KEY, 0); SV_UPGRADE_BONUS_CASH = PlayerPrefs.GetInt(SV_UPGRADE_BONUS_CASH_KEY, 0); SV_RECORD = PlayerPrefs.GetInt(SV_RECORD_KEY); SV_MONEY = PlayerPrefs.GetInt(SV_MONEY_KEY); }
void Start() { rManager = GameObject.FindGameObjectWithTag("ResourceManager").GetComponent <ResourceManager>(); mManager = GameObject.FindGameObjectWithTag("MissionManager").GetComponent <MissionManager>(); uManager = GameObject.FindGameObjectWithTag("UpgradeManager").GetComponent <UpgradeManager>(); gManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); }
// Update is called once per frame void Update() { upgrades = UpgradeManager.GetUpgrades(); //Update AOE cooldown if (cooldownAOE > 0) { cooldownAOE -= Time.deltaTime; if (cooldownAOE <= 0) { cooldownAOE = 0; } } //Find mouse location Vector3 mousePos = Input.mousePosition; mousePos = cam.ScreenToWorldPoint(mousePos); mousePos.z = 0; //Update crosshair crosshair.transform.position = mousePos; changeGun("1", gunOptions[upgrades[0]]); if (upgrades[3] > 0) { changeGun("2", "WalkieTalkie"); } }
private void Start() { ObjectPooler[] objectPoolers = FindObjectsOfType <ObjectPooler>(); foreach (ObjectPooler objectPooler in objectPoolers) { if (objectPooler.tag == "ExplosionPool") { explosionPool = objectPooler; break; } } launchTimer = spinTimer; spinTimerStore = spinTimer; launchTimerStore = launchTimer; health = maxHealth; environmentManager = FindObjectOfType <EnvironmentManager>(); scoreManager = FindObjectOfType <ScoreManager>(); enemySpawner = FindObjectOfType <EnemySpawner>(); upgradeManager = FindObjectOfType <UpgradeManager>(); healthBar = FindObjectOfType <HealthBar>(); healthBar.SetBars(maxHealth, health); Cursor.lockState = CursorLockMode.Confined; Cursor.visible = false; healthBar.ShowHealthBar(true); }
/// <summary> /// Upgrades the application. /// </summary> private void UpgradeApplication() { _startTime = DateTime.Now; WriteHeader("upgrade"); WriteMessage("<h2>Upgrade Status Report</h2>"); WriteMessage(string.Format("<h2>Current Assembly Version: {0}</h2>", UpgradeManager.GetCurrentVersion())); WriteMessage(string.Format("<h2>Current Database Version: {0}</h2>", UpgradeManager.GetInstalledVersion())); WriteMessage(string.Format("Upgrading To Version: {0}<br/>", UpgradeManager.GetCurrentVersion()), 0, true); if (UpgradeBugNET()) { WriteMessage("<h2>Upgrade Complete</h2>"); WriteMessage("<h2><a href='../Default.aspx'>Click Here To Access Your BugNET Installation</a></h2>"); var currentVersion = UpgradeManager.GetCurrentVersion(); UpgradeManager.UpdateDatabaseVersion(currentVersion); // support for a version file to be loaded to display things like breaking changes or other info // about the upgrade that was done. var installPath = Server.MapPath("~/Install"); var versionFile = Path.Combine(installPath, string.Format("{0}.htm", currentVersion)); if (File.Exists(versionFile)) { WriteMessage(File.ReadAllText(versionFile)); } } else { WriteMessage("<h2>Upgrade Failed!</h2>"); } WriteFooter(); }
public void UpgradeManagerOrdersInterUpgrades() { var upgradeManager = new UpgradeManager(new Version(), new Version()) { new VersionedInterUpgrade(new PackageUpgradeVersion(0, 1)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 2)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 3)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 4)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 8)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 7)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 6)), new VersionedInterUpgrade(new PackageUpgradeVersion(0, 5)) }; Assert.AreEqual(0, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 1))); Assert.AreEqual(1, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 2))); Assert.AreEqual(2, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 3))); Assert.AreEqual(3, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 4))); Assert.AreEqual(4, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 5))); Assert.AreEqual(5, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 6))); Assert.AreEqual(6, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 7))); Assert.AreEqual(7, upgradeManager.OrderedUpgrades.IndexOfKey(new Version(0, 8))); }
public void UpgradeManagerEnumeratesInOrder() { var upgradeManager = new UpgradeManager(new Version(), new Version()) { new VersionedAppUpgrade(new PackageUpgradeVersion(0, 4), new Version(0, 5)), new VersionedAppUpgrade(new PackageUpgradeVersion(0, 3), new Version(0, 3)), new VersionedAppUpgrade(new PackageUpgradeVersion(0, 2), new Version(0, 2)), new VersionedAppUpgrade(new PackageUpgradeVersion(0, 3), new Version(0, 4)), new VersionedAppUpgrade(new PackageUpgradeVersion(0, 1), new Version(0, 1)) }; VersionedAppUpgrade previous = null; foreach (var upgrade in upgradeManager) { if (upgrade is not VersionedAppUpgrade appUpgrade) { continue; } if (previous != null) { Assert.Greater(appUpgrade.AppVersion, previous.AppVersion); } previous = appUpgrade; } }
/// <summary> /// Adds an upgrade to the page of the specified <see cref="Mod"/>, if the upgrade is a modded upgrade or not currently used it will also be added to <see cref="UpgradeManager.UpgradeDescriptions"/> /// </summary> /// <param name="upgradeManager"></param> /// <param name="upgrade">The <see cref="UpgradeDescription"/> of the upgrade to add</param> /// <param name="mod">The <see cref="Mod"/> that owns the upgrade</param> public static void AddUpgrade(this UpgradeManager upgradeManager, UpgradeDescription upgrade, Mod mod) { if (upgrade.IsModdedUpgradeType() || !UpgradeManager.Instance.IsUpgradeTypeAndLevelUsed(upgrade.UpgradeType, upgrade.Level)) { UpgradeManager.Instance.UpgradeDescriptions.Add(upgrade); } // Old mod loading system UpgradePagesManager.AddUpgrade(upgrade.UpgradeType, upgrade.Level, mod); // New mod loading system // UpgradePagesManager.AddUpgrade(upgrade.UpgradeType, upgrade.Level, mod.ModInfo.UniqueID); if (upgrade is AbilityUpgrade) { Dictionary <UpgradeType, bool> _abilityUpgradeTypes = Accessor.GetPrivateField <UpgradeManager, Dictionary <UpgradeType, bool> >("_abilityUpgradeTypes", UpgradeManager.Instance); _abilityUpgradeTypes[upgrade.UpgradeType] = true; } if (upgrade.Requirement != null) { recursivelyAddRequirments(upgrade, mod); } string nameID = upgrade.UpgradeName.ToLower().Trim(); ModBotLocalizationManager.TryAddModdedUpgradeLocalizationStringToDictionary(nameID, upgrade.UpgradeName); string descriptionID = upgrade.Description.ToLower().Trim(); ModBotLocalizationManager.TryAddModdedUpgradeLocalizationStringToDictionary(descriptionID, upgrade.Description); }
void Start() { // find component on gameObject itsled Renderer = GetComponent <Renderer>(); // get the Upgrade manager from within the scene upgradeManager = FindObjectOfType <UpgradeManager>(); // randomly select an upgrade type to be. upgradeType = (UpgradeType)UnityEngine.Random.Range(0, 3); //change color based on random selection above switch (upgradeType) { case UpgradeType.longPaddle: Renderer.material.color = Color.yellow; break; case UpgradeType.multiBall: Renderer.material.color = Color.blue; break; case UpgradeType.ballCatcher: Renderer.material.color = Color.green; break; } }
//--------------------------------------------------------------------------------- void jump() { if (grounded()) { GameObject.FindObjectOfType <AudioManager>().play("Jump"); rb.velocity = (new Vector2(rb.velocity.x, jumpForce)); candoublejump = true; if (UpgradeManager.jumpTimes < 20) { UpgradeManager.jumpTimes++; } UpgradeManager.checkUnlocks(); } else if (!grounded()) { if (candoublejump && UpgradeManager.doubleJump) { GameObject.FindObjectOfType <AudioManager>().play("Jump"); rb.velocity = (new Vector2(rb.velocity.x, jumpForce)); candoublejump = false; } } }
/// <summary> /// Executes the SQL in file. /// </summary> /// <param name="pathToScriptFile">The path to script file.</param> /// <returns></returns> private void ExecuteSqlInFile(string pathToScriptFile) { WriteMessage(string.Format("Executing Script: {0}", pathToScriptFile.Substring(pathToScriptFile.LastIndexOf("\\") + 1)), 2, true); try { var statements = new List <string>(); if (false == File.Exists(pathToScriptFile)) { throw new Exception(string.Format("File {0} does not exist!", pathToScriptFile)); } using (Stream stream = File.OpenRead(pathToScriptFile)) { using (var reader = new StreamReader(stream)) { string statement; while ((statement = ReadNextStatementFromStream(reader)) != null) { statements.Add(statement); } } } UpgradeManager.ExecuteStatements(statements); WriteScriptSuccessError(true); } catch (Exception ex) { WriteScriptSuccessError(false); WriteScriptErrorMessage(pathToScriptFile.Substring(pathToScriptFile.LastIndexOf("\\") + 1), ex.Message); } }
/// <summary> /// Make upgrade buttons interactable when player has enough money to buy them 4 /// and deactivate corresponding button in case if player have activated the upgrade. /// </summary> /// <param name="_currencyManager"></param> private void ManageButtonsInteractibility(CurrencyManager _currencyManager) { UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, limeUpgradeBtn, limeUpgradeCost); UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, iceUpgradeBtn, iceUpgradeCost); UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, sugarUpgradeBtn, sugarUpgradeCost); UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, ultraUpgradeBtn, ultraUpgradeCost); // check if the x2 points upgrade was already applied // if it was applied disable the button if (ingredientManager.limeValueToAdd != ingredientManager.storeLimeValueToAdd) { limeUpgradeBtn.interactable = false; } if (ingredientManager.iceValueToAdd != ingredientManager.storeIceValueToAdd) { iceUpgradeBtn.interactable = false; } if (ingredientManager.sugarValueToAdd != ingredientManager.storeSugarValueToAdd) { sugarUpgradeBtn.interactable = false; } if (ingredientManager.limeValueToAdd != ingredientManager.storeLimeValueToAdd && ingredientManager.limeValueToAdd != ingredientManager.storeLimeValueToAdd * 2) { ultraUpgradeBtn.interactable = false; } }
private void OnEnable() { playerUnit = GameObject.FindObjectOfType <PlayerUnit>(); UpgradeManager = GameObject.FindObjectOfType <UpgradeManager>(); rerollCost = 0; // will become 1 RefreshUpgrades(); }
void Awake() { instance = this; UpdateCost("attackAndDefense", attackAndDefenseNum); UpdateCost("gold", goldNum); UpdateCost("time", timeNum); }
/// <summary> /// Make upgrade buttons interactable when player has enough money to buy them. /// </summary> private void ManageButtonsInteractibility(CurrencyManager _currencyManager) { UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, limeUpgradeBtn, limeUpgradeCost); UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, iceUpgradeBtn, iceUpgradeCost); UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, sugarUpgradeBtn, sugarUpgradeCost); UpgradeManager.MakeBtnInteractibleWhenEnoughMoney(_currencyManager, ultraUpgradeBtn, ultraUpgradeCost); }
/// <summary> /// Calculates bonuses for the player from upgrades. /// </summary> void calculateBonuses() { this.ropeSpeed = Constants.RopeSpeed + PlayerPrefs.GetInt("RopeSpeed") * UpgradeManager.getUpgrade("ropespeed").amtChange; this.ropeLength = Constants.RopeLength + PlayerPrefs.GetInt("RopeLength") * UpgradeManager.getUpgrade("ropelength").amtChange; this.hookSpeed = Constants.HookSpeed + PlayerPrefs.GetInt("HookSpeed") * UpgradeManager.getUpgrade("hookspeed").amtChange; if (PlayerPrefs.GetInt("HardHat") == 0) { this.hardHat.SetActive(false); } if (PlayerPrefs.GetInt("BirdShield") == 0) { this.birdShield.SetActive(false); } BoxCollider2D collider = this.GetComponent <BoxCollider2D>(); //UpgradeManager.Upgrade up = UpgradeManager.getUpgrade("bounciness"); //collider.sharedMaterial.bounciness = Constants.Bounciness + up.curr * UpgradeManager.getUpgrade("bounciness").amtChange; collider.sharedMaterial.bounciness = 0; //Apparently you need to toggle this for the material to change. collider.enabled = false; collider.enabled = true; }
private void SpawnPrefab(GameObject liquid, Vector3 position) { GameObject block = Instantiate(liquid, position, Quaternion.identity); block.transform.SetParent(pool.transform); capacity--; if (capacity <= (maxCapacity * percentage) / 10) { capacityAnimator.SetInteger("Capacity", percentage); percentage--; if (percentage == -1) { refillButton.gameObject.SetActive(true); } } //Gravity Upgrades if (type == 0) { block.GetComponent <Rigidbody2D>().gravityScale = UpgradeManager.GetInstance().UPGRADE_BEER_GRAVITY; } else if (type == 1) { block.GetComponent <Rigidbody2D>().gravityScale = UpgradeManager.GetInstance().UPGRADE_WINE_GRAVITY; } else if (type == 2) { block.GetComponent <Rigidbody2D>().gravityScale = UpgradeManager.GetInstance().UPGRADE_JUICE_GRAVITY; } Debug.Log(block.GetComponent <Rigidbody2D>().gravityScale); }
// Use this for initialization void Start() { upgradeManager = UpgradeManager.Current.GetComponent <UpgradeManager> (); // Set the power gain at an interval //InvokeRepeating ("GainPower", 0.0f, TickInterval); }
void Start() { scoreUpdate = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreUpdate>(); upgradeManager = transform.parent.parent.parent.GetComponent <UpgradeManager>(); //Getting UpgradeManager from 'weapon name Upgrades panel' lol parent.parent.parent SetLineColor(); }
public override List <EffectData> Apply(FieldManager manager, UpgradeManager upgradeManager, Random random, GameMatch match, int playerUserIndex, Combo combo) { Player player = playerUserIndex == 1 ? match.Player1 : match.Player2; Field playerField = playerUserIndex == 1 ? match.Field1 : match.Field2; UpgradesInfo playerUpgradesInfo = playerUserIndex == 1 ? match.Player1Upgrades : match.Player2Upgrades; int effectsCount = Math.Max(1, combo.Blocks.Count - FieldManager.MinComboCount); List <EffectData> data = new List <EffectData>(); float health = HealthToRestore * combo.EffectScale * upgradeManager.GetHealthBlockUpgradeBonus(playerUpgradesInfo); data.Add(EffectDataHelper.HealthData(player, health * effectsCount)); for (int i = 0; i < effectsCount; i++) { player.GainHealth(health); } if (combo.Blocks.Count > 3) { data.AddRange(BlockEffectsHelper.CreateUniqueBlock(manager, random, playerField, player, combo, ComboEffectType)); } return(data); }
// Use this for initialization void Start() { objectManager = GetComponent <ObjectManager>(); uiController = GetComponent <UIController>(); upgradeManager = GetComponent <UpgradeManager>(); NewGame(); }
public void initialize(Upgrade upgrade, UpgradeManager upgradeManager) { title.text = upgrade.objectName; description.text = upgrade.description; cost.text = ""; foreach (PlayerResource playerResource in upgrade.resourceCosts.Keys) { if (playerResource == PlayerResource.money) { cost.text += (upgrade.resourceCosts[playerResource].ToString("C2") + ", "); } else { cost.text += (upgrade.resourceCosts[playerResource] + " " + EnumHelper.GetDescription(playerResource) + ", "); } } cost.text = cost.text.Remove(cost.text.Length - 2); purchaseButton.onClick.AddListener(delegate() { if (upgradeManager.purchaseUpgrade(upgrade)) { disablePurchaseButton(); } }); }
private void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); return; } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); LoadGame(); prefabHolder = GetComponent <PrefabHolder>(); costHolder = GetComponent <UpgradeManager>(); }
internal void Save(DeepDrillerSaveData saveDataList) { var prefabIdentifier = GetComponent <PrefabIdentifier>(); var id = prefabIdentifier.Id; if (_saveData == null) { _saveData = new DeepDrillerSaveDataEntry(); } _saveData.Id = id; _saveData.BodyColor = ColorManager.GetMaskColor().ColorToVector4(); _saveData.PowerState = PowerManager.GetPowerState(); _saveData.PullFromRelay = PowerManager.GetPullFromPowerRelay(); _saveData.Items = DeepDrillerContainer.SaveData(); if (QPatch.Configuration.AllowDamage) { _saveData.Health = HealthManager.GetHealth(); } _saveData.PowerData = PowerManager.SaveData(); _saveData.FocusOres = OreGenerator.GetFocuses(); _saveData.IsFocused = OreGenerator.GetIsFocused(); _saveData.Biome = CurrentBiome; _saveData.OilTimeLeft = OilHandler.GetOilTimeLeft(); _saveData.SolarExtended = PowerManager.IsSolarExtended(); _saveData.Upgrades = UpgradeManager.Save(); saveDataList.Entries.Add(_saveData); }
public Panel() { workers = 0; roomID = 0; sacrificeButtonText = ""; faithUpgradeOneText = ""; faithUpgradeTwoText = ""; faithUpgradeThreeText = ""; isFUOne = false; isFUTwo = false; isFUThree = false; rm = ResourceManager.Instance; wm = WorkerManager.Instance; workerTypeZero = 0; workerTypeOne = 0; workerTypeTwo = 0; um = UpgradeManager.Instance; faithUpgradeOne = um.GetFaithUpgrade(); faithUpgradeTwo = um.GetFaithUpgrade(); faithUpgradeThree = um.GetFaithUpgrade(); upgradeStatus = new bool[] { false, false, false, false }; }
void Start() { PlayerManager = PlayerManager.PM; UIManager = UIManager.UIM; UpgradeManager = this.GetComponent <UpgradeManager>(); fuelManager = PlayerManager.GetComponent <fuel>(); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); upgradeManager = FindObjectOfType <UpgradeManager>(); pv = FindObjectOfType <PlayerViolence>(); movement = pv.pm.direction; size = upgradeManager.GetAttributeValue("size") + 1; range = upgradeManager.GetAttributeValue("range") + 3; speed = upgradeManager.GetAttributeValue("speed") + 1; if (movement.x != 0) { movement = new Vector2(movement.x * range * rangeMod, -1.96f); distance = rb.position + (movement); } else { distance = rb.position + (movement * (range * rangeMod)); distance.y -= 1.96f; } startTime = Time.fixedTime; gameObject.transform.localScale *= (size * sizeMod); AudioManager.Instance.PlayPlayerSFX("Rock_Ranged"); }
// Use this for initialization void Awake() { SwarmSpawner[] spawnersArr=GameObject.FindObjectsOfType<SwarmSpawner>(); spawners = new List<SwarmSpawner>(spawnersArr); soldierManager = GameObject.FindObjectOfType<SoldierManager>(); upgradeManager = GameObject.FindObjectOfType<UpgradeManager>(); foreach (SwarmSpawner spawner in spawners) { spawner.Attach(this); Health health = spawner.GetComponent<Health>(); health.Attach(this); health.Attach(upgradeManager); } }
private void OnEnable() { instance = this; string pathToResources = Application.dataPath + "/" + upgradeDataFolder; // Load the upgrade instances upgrade_Health = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_Health>(upgradeDataFolder + typeof(Upgrade_Health).Name); upgrade_HealthRegen = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_HealthRegen>(upgradeDataFolder + typeof(Upgrade_HealthRegen).Name); upgrade_Energy = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_Energy>(upgradeDataFolder + typeof(Upgrade_Energy).Name); upgrade_LifeSteal = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_LifeSteal>(upgradeDataFolder + typeof(Upgrade_LifeSteal).Name); PlayerState playerState = FindObjectOfType<PlayerState>(); if(playerState != null) { playerState.LoadState(); } }
// Use this for initialization void Start() { Upgrades = this.gameObject.GetComponent<UpgradeManager>(); }
// Use this for initialization void Awake() { soldierController = gameObject.GetComponent<SoldierManager>(); cameraMover = Camera.main.GetComponent<CameraMover>(); upgradeManager = GameObject.FindObjectOfType<UpgradeManager>().GetComponent<UpgradeManager>(); }
// Use this for initialization void Start() { drunkRect = drunkMask.GetComponent<RectTransform>(); drunkWidth = drunkRect.sizeDelta.x; GamePlayer = Player.instance; if (PauseMenu != null) { PauseMenu.SetActive(false); } if (GameOverMenu != null) { GameOverMenu.SetActive(false); } _upgradeManager = UpgradeManager.instance; if (_upgradeManager != null) { _upgradeManager.DecreaseActiveBoosts(); } StartCoroutine("DifficultyCoroutine"); }
void Awake() { enemyController = GameObject.FindObjectOfType<EnemyController>(); upgradeManager = GameObject.FindObjectOfType<UpgradeManager>(); }
protected override void Start() { base.Start(); // Grab some ref to the instances of these global systems upgradeManager = UpgradeManager.instance; myState = PlayerState.instance; playerHUD = GetComponent<UI_PlayerHUD>(); if(playerHUD == null) { Debug.LogWarning("Player does not have HUD component!"); } laserSightRenderer = GetComponent<LineRenderer>(); laserSightRenderer.enabled = false; mechComponent.RegisterDeathListener(OnDied); }
void Awake() { instance = this; DontDestroyOnLoad(gameObject); addLevelMax = 3; // CreateUpgrade(); }