private void Start() { rewardsManager = GameObject.FindObjectOfType <RewardsManager>(); panel.SetTrigger("go"); pText.text = "Welcome."; objectiveText.Play("YOUR OBJECTIVE: use W, A, S, or D to move your view."); }
public override void GiveRewards(bool bDialogResult, Sim sim, string icon, Origin origin) { if (bDialogResult) { if (RewardsManager.CheckForWin(mChanceToWin, mModifiersList, sim)) { base.ShowEventTNS(Common.LocalizeEAString(sim.IsFemale, mYesResultText, new object[] { sim }), sim.ObjectId, icon); RewardsManager.GiveRewards(mYesRewardsList, sim, origin); RewardInfoEx.GiveRewards(sim, null, mYesRewardsList); } else { base.ShowEventTNS(Common.LocalizeEAString(sim.IsFemale, mYesLoseResultText, new object[] { sim }), sim.ObjectId, icon); RewardsManager.GiveRewards(mYesLoseRewardsList, sim, origin); RewardInfoEx.GiveRewards(sim, null, mYesLoseRewardsList); } } else { base.ShowEventTNS(Common.LocalizeEAString(sim.IsFemale, mNoResultText, new object[] { sim }), sim.ObjectId, icon); RewardsManager.GiveRewards(mNoRewardsList, sim, origin); RewardInfoEx.GiveRewards(sim, null, mNoRewardsList); } }
public override void OnCompletion(out OpportunityNames triggerOpportunity) { bool opportunityWin = RewardsManager.CheckForWin(mSharedData.mCompletionWinChance, mSharedData.mModifierList, Actor); ArrayList rewardsList = opportunityWin ? mSharedData.mWinRewardsList : mSharedData.mLossRewardsList; RewardInfoEx.GiveRewards(Actor, TargetObject, rewardsList); base.OnCompletion(out triggerOpportunity); }
private void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent <Item>()) { Item it = other.GetComponent <Item>(); string itemType = it.typeOfItem; /* * if (inventory.TryGetValue(itemType, out int value)) * { * inventory[itemType] += 1; * Destroy(it.gameObject, 0.1f); * } * else * { * inventory.Add(itemType, 1); * Destroy(it.gameObject, 0.1f); * }*/ //string val = StaticFunctions.AbbreviateNumber(inventory[itemType]); if (tut) { tut.GotItem(itemType); } if (invent.storedVals.Keys.ToList().Contains(itemType)) { invent.UpdateInventory(itemType, 1); Destroy(it.gameObject); } if (!rewardsManager) { rewardsManager = GameObject.FindObjectOfType <RewardsManager>(); } else { if (itemType == "Refined Copper") { rewardsManager.copperSinceLastCheck += 1; } else if (itemType == "Refined Iron") { rewardsManager.ironSinceLastCheck += 1; } else if (itemType == "Brick") { rewardsManager.brickSinceLastCheck += 1; } else if (itemType == "Pycrete") { rewardsManager.pycreteSinceLastCheck += 1; } } } }
void Start() { anim = gameObject.GetComponent <Animator>(); invent = GameObject.FindObjectOfType <Inventory>(); proj = GameObject.FindObjectOfType <Project>(); if (GameObject.FindObjectOfType <RewardsManager>()) { rewardsManager = GameObject.FindObjectOfType <RewardsManager>(); } //set upgrade target if (level < 2) { proj.SetPanel(Mathf.RoundToInt(lvlCosts[level].x), Mathf.RoundToInt(lvlCosts[level].y), Mathf.RoundToInt(lvlCosts[level].z), Mathf.RoundToInt(lvlCosts[level].w), "Upgrade Core"); } //at the end in case there is an error tut = GameObject.FindObjectOfType <Tutorial>(); }