void ActionsInTheEnd() { //Actions is here(after timer) Info.MainHeroPosition = "right"; MainHero.IsLeft = true; MainHero.IsCanTalk = false; TopUI.SyncTopUi(); Application.LoadLevel("street_1"); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; DontDestroyOnLoad(this.gameObject); } }
static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { // Make sure we empty all our static references every time the new scene is loaded. AnimatedProps = null; CheckpointService = null; NullCheckpointService = null; CoinCointer = null; NullCoinCounter = null; VoiceoverService = null; NullVoiceoverService = null; AllLocations = null; LoadTruck = null; ControllerService = null; UnloadTruck = null; QuaryUpgradable = null; DisplayController = null; }
bool BuyItems(bool isPressedF) { if (isPressedF && CheckExit(2)) { ChangeTheLvl("Street_0"); return(true); } else { if ((bool)selected[0] && MainHero.Gold >= SwordCost) //sword { MainHero.Gold -= SwordCost; MainHero.Damage += SwordDamage; TopUI.SyncTopUi(); GoToScene(1); SetTheMarkInArray(selected, 0); return(true); } else if (MainHero.Gold < SwordCost && isPressedF) { NotEnoughGold(SwordCost); return(false); } if ((bool)selected[1] && MainHero.Gold >= ShieldCost) //shiled { MainHero.Gold -= ShieldCost; MainHero.Armor += ShieldArmor; TopUI.SyncTopUi(); GoToScene(1); SetTheMarkInArray(selected, 0); return(true); } else if (MainHero.Gold < ShieldCost) { NotEnoughGold(ShieldCost); return(false); } } return(true); }
public static ICoinCounter GetCoinCounter() { if (CoinCointer != null) { return(CoinCointer); } else { var service = GameObject.FindObjectOfType <TopUI>(); if (service != null) { CoinCointer = service; return(CoinCointer); } else { if (NullCoinCounter == null) { NullCoinCounter = new NullCoinCounter(); } return(NullCoinCounter); } } }
static void ActinsAfterGame(int award) { MainHero.Gold += award; MainHero.Level++; TopUI.SyncTopUi(); }