예제 #1
0
    private void initEnemyArea()
    {
        if (m_EnemyAreaPrefab != null)
        {
            GameObject enemy_area_object = GameObject.Instantiate(m_EnemyAreaPrefab);
            if (enemy_area_object != null)
            {
                enemy_area_object.transform.SetParent(m_CameraBattle.transform, false);
                m_BattleDispEnemy = enemy_area_object.GetComponent <BattleDispEnemy>();

                float      camera_fov = 0.0f;
                Quaternion camera_rot = Quaternion.identity;
                BattleSceneUtil.getAdjustScreenInfo(ref camera_fov, ref camera_rot);
                m_CameraBattle.fieldOfView             = camera_fov;
                m_CameraBattle.transform.localRotation = camera_rot;

                if (BattleTouchInput.HasInstance == false)
                {
                    BattleTouchInput battle_touch_input = gameObject.AddComponent <BattleTouchInput>();
                    battle_touch_input.setCamera(m_CameraBattle);
                }
                m_BattleDispEnemy.init(m_CameraBattle, transform.parent.GetComponent <Canvas>());
            }
        }
    }
예제 #2
0
 private void OnDisable()
 {
     m_MasterDataParamEnemys = null;
     if (m_BattleDispEnemy != null)
     {
         GameObject obj = m_BattleDispEnemy.gameObject;
         m_BattleDispEnemy = null;
         if (obj != null)
         {
             GameObject.Destroy(obj);
         }
     }
 }