Пример #1
0
    IEnumerator GameFlow()
    {
        yield return(new WaitForSeconds(StartDelay));

        StartCoroutine(EnemyLightController.SpawnWave(EnemyLight, WaveDelay));
        yield return(new WaitForSeconds(WaveDuration + WaveDelay));

        StartCoroutine(EnemyMediumController.SpawnWave(EnemyMedium, WaveDelay));
        yield return(new WaitForSeconds(WaveDuration + WaveDelay));

        StartCoroutine(EnemyHeavyController.SpawnWave(EnemyHeavy, WaveDelay));
        yield return(new WaitForSeconds(WaveDuration + WaveDelay));

        StartCoroutine(BossController.SpawnWave(Boss, WaveDelay));
    }
Пример #2
0
    private void Start()
    {
        /*ルートが設定されているなら、自動で設定する*/
        if (m_routeObjectParent != null)
        {
            GameObject[] routeObjectChirdren = new GameObject[m_routeObjectParent.transform.childCount];
            for (int i = 0; i < m_routeObjectParent.transform.childCount; i++)
            {
                routeObjectChirdren[i] = m_routeObjectParent.transform.GetChild(i).gameObject;
            }

            if (m_isOrderBy)
            {
                m_routeObjects = routeObjectChirdren.OrderBy(route => route.gameObject.name).ToArray();
            }
            else
            {
                m_routeObjects = routeObjectChirdren.OrderByDescending(route => route.gameObject.name).ToArray();
            }

            this.transform.position = m_routeObjects[0].transform.position;
        }

        if (m_lookAtPosParent)
        {
            m_yearDistance      = 0.1f;
            m_lookAtPosChirdlen = new GameObject[m_lookAtPosParent.transform.childCount];
            for (int i = 0; i < m_lookAtPosParent.transform.childCount; i++)
            {
                m_lookAtPosChirdlen[i] = m_lookAtPosParent.transform.GetChild(i).gameObject;
            }
            m_lookAtPosChirdlen.ToList().ForEach(pos => Debug.Log(pos.gameObject.name));
            RotateEnemy();
        }

        m_audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();

        m_audio   = GetComponentInChildren <EnemyAudioManager>();
        m_elc     = GetComponentInChildren <EnemyLightController>();
        m_rb      = GetComponent <Rigidbody>();
        m_agent   = GetComponent <NavMeshAgent>();
        m_eStatus = EnemyStatus.Patrol;
        m_player  = GameObject.FindGameObjectWithTag("Player");
        if (!m_player)
        {
            Debug.LogError("プレイヤーが取得できていない");
        }
        else
        {
            Debug.Log($"プレイヤーを取得。{m_player.name}");
        }
        m_gm = FindObjectOfType <GameManager>();

        m_adc = FindObjectsOfType <AutomationDoorController>();
        if (m_adc != null)
        {
            Debug.Log($"{this.gameObject.name}::AutomationDoorControllerを取得::{m_adc.Length + 1}個");
        }
        else
        {
            Debug.LogError("AutomationDoorControllerを取得できていない");
        }

        m_ef  = GetComponentInChildren <EnemyEffects>();
        m_eef = GetComponentInChildren <EnemyEyeField>();
        BuildSequence();

        GoToNextPoint();
    }