Exemple #1
0
        private bool doingSetup = true;                                                         //Boolean to check if we're setting up board, prevent Player from moving during setup.



        //Awake is always called before any Start functions
        void Awake()
        {
            //Check if instance already exists
            if (instance == null)
            {
                //if not, set instance to this
                instance = this;
            }

            //If instance already exists and it's not this:
            else if (instance != this)
            {
                //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
                Destroy(gameObject);
            }

            //Sets this to not be destroyed when reloading scene
            DontDestroyOnLoad(gameObject);

            //Assign enemies to a new List of Enemy objects.
            enemies    = new List <Enemy>();
            fadinglist = new List <FadingItem> ();

            //Get a component reference to the attached BoardManager script
            boardScript      = GetComponent <BoardManager>();
            resourceScript   = GetComponent <ResourcesManager>();
            controllerScript = GetComponent <ControllerPage> ();
            columns          = boardScript.columns;
            rows             = boardScript.rows;

            resourceScript.Initialize();

            //Call the InitGame function to initialize the first level
            InitGame();
        }
Exemple #2
0
        public void TestForm()
        {
            ControllerPage controllerPage = headr.ClickOnContactUs();
            bool           isFormWork     = controllerPage
                                            .ChooseSubject()
                                            .EnterEmail("*****@*****.**")
                                            .EnterMassage("Something")
                                            .PressSend().IsFormOk();

            Assert.That(isFormWork, "Form isn't work with correct datas");
        }
    void Awake()
    {
        luasupport = new LuaState();
        //Check if there is already an instance
        if (instance == null)
        {
            //if not, set it to this.
            instance = this;
        }
        //If instance already exists:
        else if (instance != this)
        {
            //Destroy this, this enforces our singleton pattern so there can only be one instance.
            Destroy(gameObject);
        }

        //Set SoundManager to DontDestroyOnLoad so that it won't be destroyed when reloading our scene.
        DontDestroyOnLoad(gameObject);
    }