Exemplo n.º 1
0
    public void CreatePlayerCutscene()
    {
        EditorGUILayout.LabelField("第四步:创建剧情运行配置文本");

        EditorGUILayout.BeginHorizontal("box");

        //   SavePathRect = ;
        //将上面的框作为文本输入框
        _PlayCutsceneFilePath = EditorGUI.TextField(EditorGUILayout.GetControlRect(true, GUILayout.ExpandWidth(true)), _PlayCutsceneFilePath);
        UtilityTools.DropToTextFiled(SavePathRect, ref _PlayCutsceneFilePath);
        FileTools.GetFileNameWithoutExtionAndFullPath(_PlayCutsceneFilePath, ref _PlayCutsceneFilePath);
        if (GUILayout.Button("复制运行文本"))
        {
            if (_ActiveDestionScene == null)
            {
                _ActiveDestionScene = EditorSceneManager.OpenScene(_DestiionSceneName, OpenSceneMode.Additive);
            }

            EditorSceneManager.SetActiveScene(_ActiveDestionScene);
            GameObject player = GameObject.Find("CutsceneSequencePlayer");
            if (player == null)
            {
                player = new GameObject("CutsceneSequencePlayer");
            }
            CutsceneSequencePlayer playercutscene = player.GetComponent <CutsceneSequencePlayer>();
            if (playercutscene == null)
            {
                playercutscene = player.AddComponent <CutsceneSequencePlayer>();
            }
            playercutscene.fileName = _PlayCutsceneFilePath;
        }
        EditorGUILayout.EndHorizontal();
    }
Exemplo n.º 2
0
    public void SetSceneSavePath(int i)
    {
        EditorGUILayout.BeginHorizontal(EditorStyles.textArea);
        EditorGUILayout.LabelField("场景配置文件的路径");
        //获得一个长300的框
        SavePathRect = EditorGUILayout.GetControlRect(true, GUILayout.ExpandWidth(true));
        //将上面的框作为文本输入框
        string vaule = EditorGUI.TextField(SavePathRect, _SceneSavePathList[i]).ToString();

        UtilityTools.DropToTextFiled(SavePathRect, ref vaule);
        _SceneSavePathList[i] = vaule;
        if (GUILayout.Button("拼接"))
        {
            Debug.Log(_SceneSavePathList[i]);
            //打开对应场景,进行拼接
            SplitJointCutscene.ReplaceArt("CutSceneArt", "CutScene", _SceneSavePathList[i], _DestiionSceneName, null, "CutScene");
            SplitJointCutscene.ReplaceArt("PathArt", "Path", _SceneSavePathList[i], _DestiionSceneName, null, "CutScenePath");
        }
        EditorGUILayout.EndHorizontal();
    }