예제 #1
0
    void Awake()
    {
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            Debug.Log("on iphone");
//			System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
            Debug.Log("didn't error");
        }

        EventControl.NewLevelReset();
        QControl.Initialize();

        playsLeftText = GameObject.Find("plays left #").GetComponent <TextMesh> ();
        movesLeftText = GameObject.Find("moves left #").GetComponent <TextMesh> ();
        dollarsText   = GameObject.Find("Dollar count").GetComponent <TextMesh> ();
        deckText      = GameObject.Find("Deck count").GetComponent <TextMesh> ();
        playButton    = GameObject.Find("play end button").GetComponent <ButtonAnimate> ();
        moveButton    = GameObject.Find("move end button").GetComponent <ButtonAnimate> ();
        endTurnButton = GameObject.Find("end turn button").GetComponent <ButtonAnimate> ();
        handObj       = GameObject.Find("Hand");
        playBoardObj  = GameObject.Find("Play board");
        playerObj     = GameObject.FindGameObjectWithTag("Player");
        player        = GameObject.FindGameObjectWithTag("Player").GetComponent <Player> ();
        gooeyskin     = (GUISkin)Resources.Load("GUISkins/S.GameControlInst.guiskin");

        SaveDataControl.Load();
        StateSavingControl.Initialize(this, player);

        if (SaveDataControl.UnlockedCards.Count == 0 | SaveDataControl.UnlockedGods.Count == 0)
        {
            SaveDataControl.NewSaveFile();
        }

        MainMenu.UnlockCheck();
    }
예제 #2
0
    /// <summary>
    /// Load enemies, Invisibledraw 3 cards, start turn.
    /// </summary>
    public void StartNewLevel(bool loadedFromSaveState = false)
    {
        handObj.transform.localPosition = new Vector3(-0.8f, 0, 0);

        if (!loadedFromSaveState)
        {
            playerObj.GetComponent <GridUnit> ().xPosition = 0;
            playerObj.GetComponent <GridUnit> ().yPosition = 0;
            Camera.main.transform.position = new Vector3(0, -1, -10);
            playerObj.transform.position   = new Vector3(0, 0, 0);

            //DIFFERENT IN TUTORIAL!
            if (Tutorial.TutorialLevel == 0)
            {
                Level++;

                int numberOfGods = (Level < 3) ? Level : 3;

                S.ShopControlInst.NewLevelNewGoals(numberOfGods);

                S.GridControlInst.LoadEnemiesAndObstacles(Level);
                InvisibleDraw();
                InvisibleDraw();
                InvisibleDraw();
            }

            EventControl.NewLevelReset();
        }

        StateSavingControl.TurnShopModeOff();

        S.ClickControlInst.AllowInputUmbrella = false;

        S.GameControlGUIInst.UnlockDim();
        S.GameControlGUIInst.Dim(false);

        StartNewTurn(loadedFromSaveState);
    }