Ejemplo n.º 1
0
    /// <summary>
    /// NOTE : Create Player setting Function GUI
    /// </summary>
    private void CreatePlayer()
    {
        GUILayout.Space(10);
        GUILayout.BeginVertical("Box");
        characterpos = EditorGUILayout.Vector2Field("Character Position", characterpos);
        GUILayout.EndVertical();

        GUILayout.Space(10);
        GUILayout.BeginVertical("Box");
        GUILayout.Label("CAT TYPE", MapToolWindow.titleFont);
        selectedTypePlayer = GUILayout.Toolbar(selectedTypePlayer, new string[] { PLAYER_TYPE.Cat1.ToString(), PLAYER_TYPE.Dog.ToString() });
        GUILayout.Label("추후 추가예정..");
        GUILayout.EndVertical();

        GUILayout.FlexibleSpace();

        if (GUILayout.Button("CREATE", GUILayout.Height(35)))
        {
            playerOb = GameObject.FindGameObjectWithTag("Player");

            //추후에 여러 플레이어 캐릭터가 존재할경우 변경 해야함
            if (playerOb != null)
            {
                DestroyImmediate(playerOb);
            }

            PLAYER_TYPE pType       = (PLAYER_TYPE)selectedTypePlayer;
            var         tmpplayerob = AssetDatabase.LoadAssetAtPath(playerPath + pType.ToString() + ".prefab", typeof(Object));
            playerOb = PrefabUtility.InstantiatePrefab(tmpplayerob) as GameObject;
            playerOb.transform.position = characterpos;

            Selection.activeGameObject = playerOb;
            EditorGUIUtility.PingObject(playerOb);
        }
        GUILayout.Space(10);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 플레이어 생성
    /// </summary>
    private void CreatePlayer(PLAYER_TYPE _playertype, string path)
    {
        var playerprefab = Resources.Load(path + _playertype.ToString()) as GameObject;

        playerOb = Instantiate(playerprefab).GetComponent <Player>();
    }
Ejemplo n.º 3
0
 public void ActiveSelectCompletePanel(PLAYER_TYPE _pType)
 {
     selectCompeletePanel.SetActive(true);
     selectCompeleteText.text = "'" + _pType.ToString() + "' START ?";
     pType = _pType;
 }