Пример #1
0
 public void Awake()
 {
     m_picker = new ListPicker(upgrades.Length);
     m_picker.selectIndex(initalPerk);
     if (initalPerk != -1)
     {
         upgrade(initalPerk);
     }
 }
Пример #2
0
        void Awake()
        {
            m_audio         = gameObject.GetComponent <AudioSource>();
            m_enemiesToKill = enemiesToKill;
            m_picker        = new ListPicker(packages.Length);

            GameObject go = GameObject.Find(playerName);

            if (go)
            {
                m_player = go.transform;
            }
            createPackage();
        }
Пример #3
0
 public void Start()
 {
     reset();
     m_picker = new ListPicker(objectsToSpawn.Length);
 }
Пример #4
0
        IEnumerator LoadNextChunk()
        {
            if (fadeOut)
            {
                fadeOut.turnOn();
            }

            if (m_picker == null)
            {
                m_picker = new ListPicker(m_chunkIndex);
            }

            int levelIndex = m_picker.pickRandomIndex() + 1 * (floorsPerFloor * floorOffset);

            levelIndex = Mathf.Clamp(levelIndex, 1, Application.levelCount - 1);
            if (m_chunkIndex == chunksToGO - 1)
            {
                m_lastLevel = true;
            }

            if (m_lastLevel)
            {
                levelIndex = Application.levelCount - 1;
            }
            int leveloffset = 0;
            int chunkIndex  = m_chunkIndex;

            while (chunkIndex >= chunksPerLevel)
            {
                chunkIndex -= chunksPerLevel;
                leveloffset++;
            }


            int maxLevel = InaneGames.Constants.getMaxLevel();

            if (leveloffset > maxLevel)
            {
                InaneGames.Constants.setMaxLevel(leveloffset);
            }

            m_count--;
            if (m_count == 0)
            {
                floorOffset++;
                m_count = floorsPerFloor;
            }
            if (text)
            {
                text.text = areasCleansed + " : " + m_chunkIndex + " / " + (chunksToGO - 1);             // + "\n" + "chunkIndex " + m_chunkIndex;
                m_chunkIndex++;
            }

            yield return(new WaitForSeconds(1));

            Destroy(GameObject.Find("Room"));
            GameObject playerGo = GameObject.Find("Player");

            playerGo.transform.position = new Vector3(1000000, 0, 0);

            if (loadAdditive)
            {
                Application.LoadLevelAdditive(levelIndex);
            }
            else
            {
                Application.LoadLevel(levelIndex);
            }
            yield return(new WaitForSeconds(.5f));

            if (fadeIn)
            {
                fadeIn.turnOn();
            }

            StartLocation location = (StartLocation)GameObject.FindObjectOfType(typeof(StartLocation));
            Vector3       pos      = playerGo.transform.position;

            if (location)
            {
                pos.x = location.transform.position.x;
                pos.z = location.transform.position.z;
            }
            else
            {
                pos.x = 24;
                pos.z = -27;
            }
            playerGo.transform.position = pos;

            GameObject cam = GameObject.Find("Camera");

            pos   = cam.transform.position;
            pos.x = -120;
            cam.transform.position = pos;
        }
Пример #5
0
 public void Awake()
 {
     m_picker = new ListPicker(maxChunkIndex, sequentially);
     m_count  = floorsPerFloor;
 }