Beispiel #1
0
 void ActionsInTheEnd()
 {
     //Actions is here(after timer)
     Info.MainHeroPosition = "right";
     MainHero.IsLeft       = true;
     MainHero.IsCanTalk    = false;
     TopUI.SyncTopUi();
     Application.LoadLevel("street_1");
 }
Beispiel #2
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
    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);
    }
Beispiel #5
0
 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);
         }
     }
 }
Beispiel #6
0
 static void ActinsAfterGame(int award)
 {
     MainHero.Gold += award;
     MainHero.Level++;
     TopUI.SyncTopUi();
 }