상속: MonoBehaviour
예제 #1
0
    private void Update()
    {
        if (this.isInIdlePhase)
        {
            return;
        }


        if (waves.Count == 0)
        {
            WaveUI.SetActive(false);
            return;
        }

        if (this.IsShoppingPhase() && this.currentShoppingTime > 0)
        {
            GameObject.Find("WaveName").GetComponent <Text>().text = "NEXT WAVE";
            this.currentShoppingTime -= Time.deltaTime;
            GameObject.Find("WaveTime").GetComponent <Text>().text = this.currentShoppingTime.ToString("F");
        }

        if (this.currentShoppingTime <= 0)
        {
            this.currentShoppingTime = this.shoppingTime;
            this.NextWave();
        }
    }
예제 #2
0
 public void WaveClear()
 {
     BGMSource.clip = BGMs[0];
     BGMSource.Play();
     for (int i = 0; i < this.SpawnObject.transform.childCount; i++)
     {
         Destroy(this.SpawnObject.transform.GetChild(i).gameObject);
     }
     for (int i = 0; i < this.ShotedObjects.transform.childCount; i++)
     {
         Destroy(this.ShotedObjects.transform.GetChild(i).gameObject);
     }
     ScoreCalculation();
     if (RemainLife == 0)
     {
         SESource.PlayOneShot(GameOverSound);
         ResultUI.SetActive(true);
     }
     else
     {
         SESource.PlayOneShot(ClearSound);
         ResultUI.SetActive(true);
     }
     WaveUI.SetActive(false);
     RightPointer.enabled = true;
     LeftPointer.enabled  = true;
     Rightgun.ShotPos.GetChild(0).gameObject.SetActive(true);
     LeftGun.ShotPos.GetChild(0).gameObject.SetActive(true);
 }
예제 #3
0
 public void BackMainMenu()
 {
     MainUI.SetActive(true);
     RankingUI.SetActive(true);
     NameInputUI.SetActive(false);
     WaveUI.SetActive(false);
 }
예제 #4
0
    /*[SerializeField] GameObject[] enemyTypes;
     * [SerializeField] float[] probs;
     * [SerializeField] float spawnDelay;
     * [SerializeField] float numberOfEnemy; */

    private void Awake()
    {
        wUI            = GetComponentInParent <WaveUI>();
        lastingEnemies = 0;
        foreach (SubWave sw in subWaves)
        {
            LastingEnemies += sw.numberOfEnemy;
        }
    }
예제 #5
0
    public void NextWave()
    {
        this.isInIdlePhase = false;

        if (!WaveUI.activeSelf)
        {
            WaveUI.SetActive(true);
        }

        // Only ask for the next wave if it's not the last one.
        if (waves.Count == 0)
        {
            WaveUI.SetActive(false);
            return;
        }

        BossController boss     = GameObject.FindGameObjectWithTag("Mountain").GetComponent <BossController>();
        Settings       settings = this.waves[0].GetComponent <WaveController>().settings;

        boss.SetBehaviourState("ProjectileSpawner", settings.projectileIsActive);
        boss.SetBehaviourState("ShockwaveSpawner", settings.shockwaveIsActive);

        // Despawn any upgrade gems that might be active somewhere on the scene.
        this.spawnPoints[0].GetComponentsInParent <Collider>(true)[0].enabled = false;
        this.DespawnUpgrades(this.spawnedObjs);

        // Enable the next wave.
        this.waves[0].SetActive(true);
        PlayWaveSound();
        if (waves.Count == 5)
        {
            PlayBattleMusic();
        }

        // Restore shield charges on wave change.
        GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <LifeUpgrade>().RestoreActiveCharges();
    }
예제 #6
0
    public void WaveStartUp(string Wave)
    {
        switch (Wave)
        {
        case "normal":
            WaveStart(WaveState.NormalWave);
            break;

        case "hard":
            WaveStart(WaveState.HardWave);
            break;

        case "master":
            WaveStart(WaveState.MasterWave);
            break;
        }
        Debug.Log("ウェーブ起動");
        Initialize();
        //ウェーブ起動
        //
        BGMSource.clip = BGMs[1];
        BGMSource.Play();
        MainUI.SetActive(false);
        RankingUI.SetActive(false);
        DifficultyUI.SetActive(false);
        SettingPanel.SetActive(false);
        WaveUI.SetActive(true);

        RightPointer.enabled = false;
        LeftPointer.enabled  = false;

        Rightgun.ShotPos.GetChild(0).gameObject.SetActive(false);
        LeftGun.ShotPos.GetChild(0).gameObject.SetActive(false);

        if (_wavestate == WaveState.NormalWave)
        {
            Rightgun.SSwitch   = true;
            LeftGun.SSwitch    = true;
            RemainLife         = 3;
            BULLETTIME.Bswitch = true;
            lifetext.text      = "LIFE:" + RemainLife.ToString();
        }
        else if (_wavestate == WaveState.HardWave)
        {
            Rightgun.SSwitch   = true;
            LeftGun.SSwitch    = true;
            RemainLife         = 3;
            BULLETTIME.Bswitch = false;
            lifetext.text      = "LIFE:" + RemainLife.ToString();
        }
        else if (_wavestate == WaveState.MasterWave)
        {
            //Gunで盾オフにする
            Rightgun.SSwitch   = false;
            LeftGun.SSwitch    = false;
            RemainLife         = 1;
            BULLETTIME.Bswitch = false;
            lifetext.text      = "LIFE:" + RemainLife.ToString();
        }
        waveing = true;
        //UIいろいろ表示
    }
예제 #7
0
    private void Start()
    {
        //    Scores =  new Dictionary<int, string>
        //{
        //    {100,"AAA"},
        //    {200,"BBB"},
        //    {300,"CCC"},
        //    {400,"DDD"},
        //    {500,"EEE"},
        //    {600,"FFF"},
        //    {700,"GGG"},
        //    {800,"HHH"},
        //    {900,"III"},
        //    {000,"JJJ"},
        //};
        BGMSource.clip = BGMs[0];
        BGMSource.Play();

        LeftPointer.enabled  = true;
        RightPointer.enabled = true;

        //for(int i = 0; i < Lasers.Capacity; i++)
        //{
        //    Lasers[i].gameObject.SetActive(true);
        //}

        RightControllermodel.SetActive(false);
        LeftControllermodel.SetActive(false);
        MainUI.SetActive(true);
        RankingUI.SetActive(true);
        DifficultyUI.SetActive(false);
        SettingPanel.SetActive(false);
        WaveUI.SetActive(false);
        NameInputUI.SetActive(false);
        WaveUI.SetActive(false);

        Rightgun.SSwitch = true;
        LeftGun.SSwitch  = true;

        BULLETTIME.Bswitch = false;
        //Rightgun.ShotPos.GetChild(0).gameObject.SetActive(true);
        //LeftGun.ShotPos.GetChild(0).gameObject.SetActive(true);
        Load();

        Entity_Sheet1.sheets[0].list.Sort((a, b) => a.Score + b.Score);
        foreach (Entity_Sheet1.Sheet localdatasheet in Entity_Sheet1.sheets)
        {
            int i = 0;
            if (localdatasheet.list.Count == 0)
            {
                for (int num = 0; num < 10; num++)
                {
                    NamesText[num].text  = "AAA";
                    Modestext[num].text  = "normal";
                    Scorestext[num].text = "0";
                }
                break;
            }
            foreach (Entity_Sheet1.Param localdataparam in localdatasheet.list)
            {
                NamesText[i].text  = localdataparam.Name;
                Modestext[i].text  = localdataparam.Mode;
                Scorestext[i].text = localdataparam.Score.ToString();
                if (i == 9)
                {
                    break;
                }
                i++;
            }
        }
    }
예제 #8
0
 //TODO: Error on ine 26
 //TODO: Main Menu
 //TODO: Particles
 void Awake()
 {
     gameManager = GetComponent <GameManager>();
     waveTimer   = GetComponent <WaveTimer>();
     waveUI      = GetComponent <WaveUI>();
 }