Esempio n. 1
0
        // Use this for initialization
        void Start()
        {
            buttonSpawn.Init();

            txtTimer.text = "";

            List <Rsc> rscList = ResourceManager.GetResourceList();

            for (int i = 0; i < rscList.Count; i++)
            {
                if (i == 0)
                {
                    rscObjList[i].Init();
                }
                else
                {
                    rscObjList.Add(rscObjList[0].Clone("RscObj" + i, new Vector3(i * 1, -40, 0)));
                }
                rscObjList[i].imageIcon.sprite = rscList[i].icon;
            }

            OnLife(0);
            OnNewWave(1);
            OnResourceChanged(new List <int>());

            if (SpawnManager.AutoStart())
            {
                buttonSpawn.rootObj.SetActive(false);
                //StartCoroutine(AutoStartTimer());
                OnSpawnTimer(SpawnManager.GetAutoStartDelay());
            }
        }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            _instance     = this;
            init          = true;
            txtTimer.text = "Start Game";

            scoreObj.SetActive(false);
            OnLife(0);
            OnNewWave(1);
            OnResourceChanged(0);

            if (SpawnManager.AutoStart())
            {
                buttonSpawn.SetActive(false);
                OnSpawnTimer(SpawnManager.GetAutoStartDelay());
            }
        }
Esempio n. 3
0
        // Use this for initialization
        void Start()
        {
            buttonSpawn.Init();

            txtTimer.text = "";

            List <Rsc> rscList = ResourceManager.GetResourceList();

            for (int i = 0; i < rscList.Count; i++)
            {
                if (i == 0)
                {
                    rscObjList[i].Init();
                }
                else
                {
                    rscObjList.Add(rscObjList[0].Clone("RscObj" + i, new Vector3(i * 90, 0, 0)));
                }
                rscObjList[i].imageIcon.sprite = rscList[i].icon;
            }

            OnLife(0);
            OnNewWave(1);
            OnResourceChanged(new List <int>());
            OnScoreChanged(0);

            if (SpawnManager.AutoStart())
            {
                buttonSpawn.rootObj.SetActive(false);
                //StartCoroutine(AutoStartTimer());
                OnSpawnTimer(SpawnManager.GetAutoStartDelay());
            }


            storyRect = storyObj.GetComponent <RectTransform>();
            storyRect.Translate(0, 0, 0);
            defaultX = storyRect.position.x;

            storyObj.SetActive(true);
            storyAudio.Play();

            infoImages = GameObject.FindGameObjectsWithTag("InfoImagesTag");
            OnInfoButton();
        }