Example #1
0
        /// <summary>
        /// 플레이어가 요청하는 캐릭터를 생성하고 연결 시킵니다.
        /// </summary>
        /// <param name="_type">생성할 플레이어 캐릭터의 타입</param>
        public void Possess(Character_List _type)
        {
            GameObject prefab = null;

            switch (_type)
            {
            case Character_List.Dark_Knight:
                prefab = OutGameManager.Instance.prefab_player_character[_type];
                break;

            default:
                Debug.LogError(typeof(PlayerComponent).Name + " : 생성할 플레이어의 타입이 없습니다.");
                return;
            }
            Transform  parent       = OutGameManager.Instance.parent_character;
            GameObject l_gameobject = InGameManager.CreatePrefab(prefab, parent, "Dark Knight");

            if (l_gameobject.GetComponent <CharacterComponent>() != null)
            {
                SetCharacter(l_gameobject.GetComponent <CharacterComponent>());
            }
            else
            {
                Debug.Log(l_gameobject.name + " : 객체에 CharacterCompoenent가 없습니다.");
                GameObject.Destroy(l_gameobject);
                return;
            }
        }
Example #2
0
 public GameObject this[Character_List type] {
     get => m_dictionary[type];