public void draw() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(TC.get("Effect.PlayAnimation")); if (GUILayout.Button(clearImg)) { OnSlidesceneChanged(""); } GUILayout.Box(slidesPath); if (GUILayout.Button(TC.get("Buttons.Select"))) { AnimationFileOpenDialog animationDialog = (AnimationFileOpenDialog)ScriptableObject.CreateInstance(typeof(AnimationFileOpenDialog)); animationDialog.Init(this, BaseFileOpenDialog.FileType.PLAY_ANIMATION_EFFECT); } // Create/edit slidescene if (GUILayout.Button(TC.get("Resources.Create") + "/" + TC.get("Resources.Edit"))) { // For not-existing cutscene - show new cutscene name dialog if (slidesPath == null || slidesPath.Equals("")) { CutsceneNameInputPopup createCutsceneDialog = (CutsceneNameInputPopup)ScriptableObject.CreateInstance(typeof(CutsceneNameInputPopup)); createCutsceneDialog.Init(this, ""); } else { EditCutscene(); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.HelpBox(TC.get("PlayAnimationEffect.Description"), MessageType.Info); }
public override void Draw(int aID) { var windowWidth = m_Rect.width; var windowHeight = m_Rect.height; previewRect = new Rect(0f, 0.5f * windowHeight, windowWidth, windowHeight * 0.45f); /* * View for videoscene */ if (Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].isVideoscene()) { // Background chooser GUILayout.Label(TC.get("Resources.DescriptionVideoscenes")); GUILayout.BeginHorizontal(); if (GUILayout.Button(clearImg, GUILayout.Width(0.1f * windowWidth))) { OnVideosceneChanged(""); } GUILayout.Box(videoscenePath, GUILayout.Width(0.6f * windowWidth)); if (GUILayout.Button(TC.get("Buttons.Select"), GUILayout.Width(0.1f * windowWidth))) { ShowAssetChooser(AssetType.VIDEOSCENE); } GUILayout.EndHorizontal(); GUILayout.Space(30); GUILayout.Label(TC.get("Videoscene.Skip.border")); canSkipVideo = GUILayout.Toggle(canSkipVideo, new GUIContent(TC.get("Videoscene.Skip.label"))); if (canSkipVideo != canSkipVideoLast) { OnVideosceneCanSkipVideoChanged(canSkipVideo); } } /* * View for slidescene */ else { // Background chooser GUILayout.Label(TC.get("Resources.DescriptionSlidesceneSlides")); GUILayout.BeginHorizontal(); if (GUILayout.Button(clearImg, GUILayout.Width(0.1f * windowWidth))) { OnSlidesceneChanged(""); } GUILayout.Box(slidesPath, GUILayout.ExpandWidth(true)); if (GUILayout.Button(TC.get("Buttons.Select"), GUILayout.Width(0.1f * windowWidth))) { ShowAssetChooser(AssetType.SELECT_SLIDES); } // Create/edit slidescene if (GUILayout.Button(TC.get("Resources.Create") + "/" + TC.get("Resources.Edit"), GUILayout.Width(0.18f * windowWidth))) { // For not-existing cutscene - show new cutscene name dialog if (slidesPath == null || slidesPath.Equals("")) { CutsceneNameInputPopup createCutsceneDialog = (CutsceneNameInputPopup)ScriptableObject.CreateInstance(typeof(CutsceneNameInputPopup)); createCutsceneDialog.Init(this, ""); } else { EditCutscene(); } } GUILayout.EndHorizontal(); // Music chooser GUILayout.BeginHorizontal(); if (GUILayout.Button(clearImg, GUILayout.Width(0.1f * windowWidth))) { musicPath = ""; } GUILayout.Box(musicPath, GUILayout.ExpandWidth(true)); if (GUILayout.Button(TC.get("Buttons.Select"), GUILayout.Width(0.19f * windowWidth))) { ShowAssetChooser(AssetType.MUSIC); } GUILayout.EndHorizontal(); } GUILayout.Space(30); GUILayout.Label(TC.get("ImageAssets.Preview")); if (Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].isVideoscene()) { if (slidePreviewMovie != null) { GUI.DrawTexture(previewRect, slidePreviewMovie, ScaleMode.ScaleToFit); } } else { if (slidesPath != "" && slidesPreview != null) { GUI.DrawTexture(previewRect, slidesPreview, ScaleMode.ScaleToFit); } } }