void Start()
 {
     player       = GameObject.FindWithTag("Player");
     audio        = GameObject.Find("EnemyAudioManager").GetComponent <EnemyAudioManager>();
     BS           = this.GetComponent <BulletSpawnEnemy> ();
     frameCounter = 0;
     shootRange   = distanceMax + 1;
 }
Ejemplo n.º 2
0
    void Start()
    {
        if (instance != null)
        {
            Debug.LogError("Should not have more than one EnemyAudioManager");
        }

        instance = this;
    }
Ejemplo n.º 3
0
    private void Awake()
    {
        EnemyAttributes = GetComponent <EnemyAttributes>();
        EnemyAttributes.SetManager(this);

        EnemyAudioManager = GetComponentInChildren <EnemyAudioManager>();
        EnemyAudioManager.SetManager(this);

        EnemyMovement = GetComponent <EnemyMovement>();
        EnemyMovement.SetManager(this);
    }
Ejemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         GameObject.DontDestroyOnLoad(this.gameObject);
         instance = this;
     }
     else
     {
         GameObject.Destroy(this.gameObject);
     }
 }
Ejemplo n.º 5
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();
    }