Inheritance: MonoBehaviour
Example #1
0
    public void SaveGame()
    {
        if (HexagonalGrid.Instance == null)
        {
            return;
        }
        needLoad = true;
        HexagonalCell[] cells  = HexagonalGrid.Instance.GetAllCells();
        int             lenght = cells.Length;

        SaveInfo.Cards = new Cards.CardData[lenght];
        for (int i = 0; i < lenght; i++)
        {
            SaveInfo.Cards[i] = cells[i].GetCard().Info;
        }

        HudUI score = FindObjectOfType <HudUI>();

        SaveInfo.Score       = score.GetScore();
        SaveInfo.Turn        = score.GetTurn();
        SaveInfo.untilClosed = ManagerClosedCard.Instance.currentProgress;

        string obj = JsonUtility.ToJson(SaveInfo);

        PlayerPrefs.SetString("load", obj);
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     score = FindObjectOfType <HudUI>();
     StartCoroutine("FlashCombinationAlternately");
 }
    void Awake()
    {
        songController = (SongController)FindObjectOfType (typeof(SongController));
        concertController = (ConcertController)FindObjectOfType (typeof(ConcertController));
        tourController = (TourController)FindObjectOfType(typeof(TourController));
        merchController = (MerchController)FindObjectOfType(typeof(MerchController));
        equipmentController = (EquipmentController)FindObjectOfType(typeof(EquipmentController));
        hudUI = (HudUI)FindObjectOfType(typeof(HudUI));

        currencyState = GameState.instance.Currency;
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     hudUI = FindObjectOfType <HudUI>();
     if (LoadManager.Instance.needLoad)
     {
         currentProgress = LoadManager.Instance.SaveInfo.untilClosed;
     }
     hudUI.SetTextClosedCard(currentProgress);
 }
Example #5
0
 // Use this for initialization
 void Start()
 {
     SoundManager.Instance.PlayMixStart();
     turnBack    = FindObjectOfType <TurnBack>();
     hud         = FindObjectOfType <HudUI>();
     myTransform = transform;
     startPos    = transform.position;
     myCard      = GetComponent <Card>();
     if (LoadManager.Instance.needLoad)
     {
         Invoke("LoadNewCard", .01f);
     }
     else
     {
         Invoke("CreateNewCard", .01f);
     }
 }
Example #6
0
 void Awake()
 {
     hud = (HudUI)FindObjectOfType(typeof(HudUI));
     restart = (RestartUI)FindObjectOfType(typeof(RestartUI));
 }
Example #7
0
    void SetupHud()
    {
        switch (GameMode)
        {
            case FlightMode.TimeTrial:
                _hudUI = (GameObject)Instantiate(Globals.UI_Hud_TimeTrial);
                break;
            case FlightMode.Race:
                break;
            case FlightMode.Infinite:
                break;
            case FlightMode.Test:
                break;
        }
        _hud = _hudUI.GetComponent<HudUI>();

        if (Globals.FlightController.GetAxisInput().GetUIPrefab() != null)
        {
            Debug.Log("Instantiating Flight UI");
            _flightUI = (GameObject)Instantiate(Globals.FlightController.GetAxisInput().GetUIPrefab());
            Globals.FlightController.GetAxisInput().SetUI(_flightUI);
        }
    }
Example #8
0
    void DestroyLevel()
    {
        // Kill ui
        if (_hudUI != null)
        {
            DestroyObject(_hudUI);
            _hudUI = null;
            _hud = null;
        }

        if(_flightUI != null)
        {
            DestroyObject(_flightUI);
            _flightUI = null;
        }

        _finishLine = null;
        _obstacles.Clear();
    }
Example #9
0
 void Awake()
 {
     hud     = (HudUI)FindObjectOfType(typeof(HudUI));
     restart = (RestartUI)FindObjectOfType(typeof(RestartUI));
 }
Example #10
0
 void Awake()
 {
     restart = FindObjectOfType<RestartUI>();
     hud = FindObjectOfType<HudUI>();
 }
Example #11
0
 void Awake()
 {
     hudUI = (HudUI)FindObjectOfType(typeof(HudUI));
     tapController = (TapController)FindObjectOfType(typeof(TapController));
     tourController = (TourController)FindObjectOfType(typeof(TourController));
 }
Example #12
0
 void Awake()
 {
     hud = (HudUI)FindObjectOfType (typeof(HudUI));
     songController = (SongController)FindObjectOfType(typeof(SongController));
     tourController = (TourController)FindObjectOfType(typeof(TourController));
 }
Example #13
0
 protected void Awake()
 {
     _instance = this;
 }