public override void OnInspectorGUI() { base.OnInspectorGUI(); _target = (BasicSource)target; if (EditorTools.DrawHeader("Tracker params")) { selectIdx = EditorGUILayout.Popup(selectIdx, new string[] { "iOS", "Android", "Mac", "Windows", "Edtor" }); EditorTools.BeginContents(); if (_target.mirror == null || _target.mirror.Length < 5) { reset(); } if (_target.trackRotation == null || _target.trackRotation.Length < 5) { reset(); } _target.mirror[selectIdx] = EditorGUILayout.Toggle("Mirror", _target.mirror[selectIdx] == 1)?1:0; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Rotation:", GUILayout.Width(50)); float tempValue = GUILayout.HorizontalSlider((float)_target.trackRotation [selectIdx], 0.0f, 360.0f); _target.trackRotation [selectIdx] = (int)tempValue; _target.trackRotation [selectIdx] = (int)Mathf.Floor(tempValue / 90) * 90; EditorGUILayout.LabelField(_target.trackRotation [selectIdx].ToString(), GUILayout.Width(50)); EditorGUILayout.EndHorizontal(); } if (GUILayout.Button("Reset")) { reset(); } }
protected void Draw_AvatarCapsule() { AvatarController avatar = target as AvatarController; if (EditorTools.DrawHeader("角色胶囊体", false, false)) { EditorTools.BeginContents(false); Vector3 center = EditorGUILayout.Vector3Field("偏移中心", avatar.capsule.center); float rad = EditorGUILayout.FloatField("半径", avatar.capsule.radius, GUILayout.Width(170)); float hei = EditorGUILayout.FloatField("高度", avatar.capsule.height, GUILayout.Width(170)); float bound_rad = EditorGUILayout.FloatField("约束半径", avatar.capsule.boundRadius, GUILayout.Width(170)); //GUILayout.BeginHorizontal(); //GUILayout.EndHorizontal(); if (GUI.changed) { EditorTools.RegisterUndo("AvatarController Change", avatar); avatar.capsule.center = center; avatar.capsule.radius = rad; avatar.capsule.height = hei; avatar.capsule.boundRadius = bound_rad; EditorTools.SetDirty(avatar); } EditorTools.EndContents(); } }
void TabSettingGUI() { InfoHeaderGUI(); //----------------------------- EditorTools.DrawHeader("Maker Bundle", true); EditorTools.BeginContents(false); DrawSettingItem("Extenstion Name \u25BA " + EditorABSetting.eBUILDTARGET.Windows.ToString(), ref EditorABSetting.strArrayBuildExtension[0], EditorABSetting.DEF_BUNDLE_EXTENSION[0]); DrawSettingItem("Extenstion Name \u25BA " + EditorABSetting.eBUILDTARGET.iOS.ToString(), ref EditorABSetting.strArrayBuildExtension[1], EditorABSetting.DEF_BUNDLE_EXTENSION[1]); DrawSettingItem("Extenstion Name \u25BA " + EditorABSetting.eBUILDTARGET.Android.ToString(), ref EditorABSetting.strArrayBuildExtension[2], EditorABSetting.DEF_BUNDLE_EXTENSION[2]); DrawSettingItem("Extenstion Name \u25BA " + EditorABSetting.eBUILDTARGET.WSAPlayer.ToString(), ref EditorABSetting.strArrayBuildExtension[3], EditorABSetting.DEF_BUNDLE_EXTENSION[3]); EditorTools.EndContents(); EditorTools.DrawHeader("Config Info", true); EditorTools.BeginContents(false); foreach (KeyValuePair <string, string> pair in config) { if (pair.Key != string.Empty) { GUILayout.BeginHorizontal(); GUILayout.Label(pair.Key); GUILayout.Label(pair.Value); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.TextField(" "); EditorGUILayout.TextField(" "); GUILayout.EndHorizontal(); } } EditorTools.EndContents(); }
// private static EditorAAEventMaker mEditorAAEventMaker; protected void Draw_AnimationMotion() { AvatarController avatar = target as AvatarController; if (EditorTools.DrawHeader("角色动画", false, false)) { EditorTools.BeginContents(false); GUI.color = Color.green; if (GUILayout.Button("打开角色动作事件编辑器", GUILayout.Height(40))) { var maker = EditorWindow.GetWindow <AvatarClipMaker>(); if (maker.Target == avatar) { maker.Focus(); } else { maker.Close(); EditorWindow.GetWindow <AvatarClipMaker>(string.Format("编辑动作事件({0})", avatar.name), true).Show(avatar); } } GUI.color = Color.white; EditorTools.EndContents(); } }
public override void OnInspectorGUI() { SerializedProperty useWorldClockApiProp = serializedObject.FindProperty("useWorldClockApi"); SerializedProperty rewardsProp = serializedObject.FindProperty("rewards"); SerializedProperty isSingletonProp = serializedObject.FindProperty("isSingleton"); SerializedProperty keepOpenProp = serializedObject.FindProperty("keepOpen"); EditorGUILayout.PropertyField(isSingletonProp, new GUIContent("Is Singleton?", "Is it singleton or the reward is reloaded on each scene?")); EditorGUILayout.PropertyField(keepOpenProp, new GUIContent("Keep Open?", "Do the Canvas pops up even when there is no reward available?")); useWorldClockApiProp.boolValue = EditorGUILayout.Toggle(new GUIContent("Use World Clock?"), useWorldClockApiProp.boolValue); if (useWorldClockApiProp.boolValue && EditorTools.DrawHeader("World Clock")) { if (useWorldClockApiProp.boolValue) { SerializedProperty worldClockUrlProp = serializedObject.FindProperty("worldClockUrl"); SerializedProperty worldClockFmtProp = serializedObject.FindProperty("worldClockFMT"); EditorGUILayout.PropertyField(worldClockUrlProp, new GUIContent("World Clock URL")); EditorGUILayout.PropertyField(worldClockFmtProp, new GUIContent("World Clock Format")); } } if (EditorTools.DrawHeader("Rewards")) { // Rewards for (int i = 0; i < rewardsProp.arraySize; i++) { if (EditorTools.DrawHeader("Day " + (i + 1))) { EditorTools.BeginContents(); SerializedProperty rewardProp = rewardsProp.GetArrayElementAtIndex(i); var unitRewardProp = rewardProp.FindPropertyRelative("unit"); var rewardQtProp = rewardProp.FindPropertyRelative("reward"); var rewardSpriteProp = rewardProp.FindPropertyRelative("sprite"); EditorGUILayout.PropertyField(unitRewardProp, new GUIContent("Unit")); EditorGUILayout.PropertyField(rewardQtProp, new GUIContent("Reward")); rewardSpriteProp.objectReferenceValue = EditorGUILayout.ObjectField("Sprite", rewardSpriteProp.objectReferenceValue, typeof(Sprite), false); EditorTools.EndContents(); if (GUILayout.Button("Remove Reward")) { rewardsProp.DeleteArrayElementAtIndex(i); } } } if (GUILayout.Button("Add Reward")) { rewardsProp.InsertArrayElementAtIndex(rewardsProp.arraySize); } } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); UISpriteAnimation uisprite = target as UISpriteAnimation; GUILayout.Space(10); EditorTools.BeginContents(false); drawSprite(uisprite); EditorTools.EndContents(); }
void InfoHeaderGUI() { EditorTools.DrawHeader("Info", true); EditorTools.BeginContents(false); GUI.contentColor = Color.white; GUILayout.Label("\u25BA Absolute Project Path > " + EditorABSetting.GetProjectPath()); GUILayout.Label("\u25BA Current Build Setting Platform > " + EditorUserBuildSettings.activeBuildTarget.ToString()); GUILayout.Label("\u25BA Selected Bundle Extenstion > " + EditorABSetting.GetBundleExtenstion()); GUILayout.Label("\u25BA BundleExport FullPath > " + EditorABSetting.GetBuildExportFullPath()); GUI.contentColor = Color.white; EditorTools.EndContents(); }
protected void DrawCommonProperties() { UITweener tw = target as UITweener; if (EditorTools.DrawHeader("Tweener")) { EditorTools.BeginContents(); EditorTools.SetLabelWidth(110f); GUI.changed = false; UITweener.Style style = (UITweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.style); AnimationCurve curve = EditorGUILayout.CurveField("Animation Curve", tw.animationCurve, GUILayout.Width(170f), GUILayout.Height(62f)); //UITweener.Method method = (UITweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.method); GUILayout.BeginHorizontal(); float dur = EditorGUILayout.FloatField("Duration", tw.duration, GUILayout.Width(170f)); GUILayout.Label("seconds"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); float del = EditorGUILayout.FloatField("Start Delay", tw.delay, GUILayout.Width(170f)); GUILayout.Label("seconds"); GUILayout.EndHorizontal(); int tg = EditorGUILayout.IntField("Tween Group", tw.tweenGroup, GUILayout.Width(170f)); bool ts = EditorGUILayout.Toggle("Ignore TimeScale", tw.ignoreTimeScale); if (GUI.changed) { tw.animationCurve = curve; //tw.method = method; tw.style = style; tw.ignoreTimeScale = ts; tw.tweenGroup = tg; tw.duration = dur; tw.delay = del; EditorTools.SetDirty(tw); } EditorTools.EndContents(); } EditorTools.SetLabelWidth(80f); //EditorTools.DrawEvents("On Finished", tw, tw.onFinished); }
public bool DrawFXEffects(Component fx, List <EffectBase> effects) { bool ischange = false; GUI.backgroundColor = Color.green; if (GUILayout.Button("绑定效果", GUILayout.Height(30))) { effects.Clear(); foreach (var v in fx.GetComponentsInChildren <EffectBase>(true)) { effects.Add(v); } ischange = true; } GUI.backgroundColor = Color.white; for (int k = 0; k < effects.Count; k++) { GUILayout.Space(6); var effect = effects [k]; bool click = false; GUI.color = Color.white; EditorTools.BeginContents(false); if (EditorTools.DrawHeaderItem(string.Format("<{0}> {1}", effect.GetType().Name, effect.effectName), effect.GetType().Name + 1, "删除", ref click, Color.red)) { var effectEditor = GetEditor(effect); if (effectEditor != null) { GUI.backgroundColor = new Color(0.5f, 0.8f, 1, 1); effectEditor.OnInspectorGUI(); } } EditorTools.EndContents(); GUI.backgroundColor = Color.white; if (click) { effects.RemoveAt(k); k++; ischange = true; } } return(ischange); }
private void DrawPressed() { //EditorGUIUtility.labelWidth = 120f; ButtonScale mScale = target as ButtonScale; bool showPressed = EditorGUILayout.Toggle("Show Pressed", mScale.showPressed); if (mScale.showPressed != showPressed) { mScale.showPressed = showPressed; } if (mScale.showPressed) { if (EditorTools.DrawHeader("Pressed")) { EditorTools.BeginContents(); GUILayout.BeginVertical(); //EditorGUIUtility.labelWidth = 100f; GUILayout.Space(4f); Vector3 pressed = EditorGUILayout.Vector3Field("Scale", mScale.pressed); if (mScale.pressed != pressed) { mScale.pressed = pressed; } GUILayout.Space(4f); float pressedDuration = EditorGUILayout.FloatField("Duration", mScale.pressedDuration); if (mScale.pressedDuration != pressedDuration) { mScale.pressedDuration = pressedDuration; } GUILayout.Space(4f); GUILayout.EndVertical(); EditorTools.EndContents(); } } }
private void DrawHover() { ButtonScale mScale = target as ButtonScale; bool showHover = EditorGUILayout.Toggle("Show Hover", mScale.showHover); if (mScale.showHover != showHover) { mScale.showHover = showHover; } if (mScale.showHover) { if (EditorTools.DrawHeader("Hover")) { EditorTools.BeginContents(); GUILayout.BeginVertical(); //EditorGUIUtility.labelWidth = 100f; GUILayout.Space(4f); Vector3 hover = EditorGUILayout.Vector3Field("Scale", mScale.hover); if (mScale.hover != hover) { mScale.hover = hover; } GUILayout.Space(4f); float hoverDuration = EditorGUILayout.FloatField("Duration", mScale.hoverDuration); if (mScale.hoverDuration != hoverDuration) { mScale.hoverDuration = hoverDuration; } GUILayout.Space(4f); GUILayout.EndVertical(); EditorTools.EndContents(); } } }
protected void Draw_MoveMotion() { GUI.backgroundColor = Color.white; if (EditorTools.DrawHeader("角色运动", false, false)) { EditorTools.BeginContents(false); AvatarController avatar = target as AvatarController; float speed = EditorGUILayout.FloatField("移动速度", avatar.motion.speedMove, GUILayout.Width(170)); float speedTurn = EditorGUILayout.FloatField("转向速度", avatar.motion.speedTurn, GUILayout.Width(170)); float bounds = EditorGUILayout.FloatField("距离偏差", avatar.motion.distanceBounds, GUILayout.Width(170)); if (GUI.changed) { EditorTools.RegisterUndo("AvatarController Change", avatar); avatar.motion.speedMove = speed; avatar.motion.speedTurn = speedTurn; avatar.motion.distanceBounds = bounds; EditorTools.SetDirty(avatar); } EditorTools.EndContents(); } }
public override void OnInspectorGUI() { MEHoloEntrance entrance = (MEHoloEntrance)target; GameObject holoRoot = GameObject.Find("MEHolo"); if (holoRoot == null) { base.OnInspectorGUI(); EditorGUILayout.Space(); EditorGUILayout.Space(); if (GUILayout.Button("Create All MEHolo Module")) { holoRoot = new GameObject("MEHolo"); InstantiatePrefabToParent(entrance.AccountPrefab, holoRoot.transform); #if true // UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA InstantiatePrefabToParent(entrance.AnchorPrefab, holoRoot.transform); #endif InstantiatePrefabToParent(entrance.InputPrefab, holoRoot.transform); InstantiatePrefabToParent(entrance.SpeechPrefab, holoRoot.transform); InstantiatePrefabToParent(entrance.UIPerfab, holoRoot.transform); InstantiatePrefabToParent(entrance.CollaborationPrefab, holoRoot.transform); InstantiatePrefabToParent(entrance.LibraryPrefab, holoRoot.transform); InstantiatePrefabToParent(entrance.LivePrefab, holoRoot.transform); } return; } GUI.changed = false; GUIStyle nameStyle = new GUIStyle(GUI.skin.box); nameStyle.fontSize = 20; nameStyle.padding = new RectOffset(10, 10, 10, 10); nameStyle.margin = new RectOffset(10, 10, 10, 10); string showName = null; bool needInput = false; if (string.IsNullOrEmpty(entrance.AppID)) { showName = "Please Set App ID"; nameStyle.normal.textColor = new Color(0.7f, 0f, 0f); needInput = true; } else { showName = "App ID: " + entrance.AppID; nameStyle.normal.textColor = new Color(0f, 0.7f, 0f); needInput = false; } GUILayout.Box(showName, nameStyle); if (needInput) { newId = EditorGUILayout.TextField("App ID:", newId); if (GUILayout.Button("Set App ID")) { entrance.AppID = newId; } } else { if (GUILayout.Button("Remove this id")) { if (EditorUtility.DisplayDialog("Confirm", "Do you want to delete this id?", "Confirm", "Cancel")) { entrance.AppID = null; } } } EditorGUILayout.Space(); EditorGUILayout.Space(); entrance.NeedAccount = EditorGUILayout.Toggle("If Need Account:", entrance.NeedAccount); #if true // UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA // Anchor默认开启,不可关闭 entrance.NeedAnchor = true; /* * entrance.NeedAnchor = EditorGUILayout.Toggle("If Need Anchor:", entrance.NeedAnchor); * if (entrance.NeedAnchor) * { * entrance.NeedInput = true; * } */ #endif // Input默认开启,不可关闭 //entrance.NeedInput = EditorGUILayout.Toggle("If Need Input:", entrance.NeedInput); entrance.NeedInput = true; // UI默认开启,不可关闭 //entrance.NeedUI = EditorGUILayout.Toggle("If Need UI:", entrance.NeedUI); entrance.NeedUI = true; entrance.NeedCollaboration = EditorGUILayout.Toggle("If Need Collaboration:", entrance.NeedCollaboration); entrance.NeedLibrary = EditorGUILayout.Toggle("If Need Library:", entrance.NeedLibrary); // Speech默认开启,不可关闭 //entrance.NeedSpeech = EditorGUILayout.Toggle("If Need Speech:", entrance.NeedSpeech); entrance.NeedSpeech = true; entrance.NeedLive = EditorGUILayout.Toggle("If Need Live!:", entrance.NeedLive); if (entrance.NeedLive) { #if true // UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA entrance.NeedAnchor = true; #endif } EditorGUILayout.Space(); EditorGUILayout.Space(); if (EditorTools.DrawHeader("Toolkit Settings")) { EditorTools.BeginContents(); entrance.systemMenuData = (TextAsset)EditorGUILayout.ObjectField("System Menu Data", entrance.systemMenuData, typeof(TextAsset), false); EditorTools.EndContents(); } if (GUI.changed) { UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene()); EditorUtility.SetDirty(entrance); } }
void TabFTPGUI() { EditorTools.DrawHeader("Info", true); EditorTools.BeginContents(false); GUILayout.Label("< Local Target Directory > " + EditorABSetting.GetBuildExportFullPath()); GUILayout.Label("< FTP Target Directory > " + FTP.GetAddress() + EditorABSetting.strExportPath + "/" + EditorABSetting.emBuildTarget.ToString() + "/"); EditorTools.EndContents(); EditorTools.DrawHeader("FTP Login", true); string tempAddress = FTP.ftpAddress; DrawFTPLogin("FTP Address", ref FTP.ftpAddress); if (tempAddress != FTP.ftpAddress) { FTP.SaveLoinInfo(); } string tempID = FTP.Id; DrawFTPLogin("ID", ref FTP.Id); if (tempID != FTP.Id) { FTP.SaveLoinInfo(); } GUILayout.BeginHorizontal(); GUILayout.Label("PASSWORD", GUILayout.Width(80f)); GUILayout.Space(5f); string tempPwd = EditorGUILayout.PasswordField(FTP.Password); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); if (tempPwd != FTP.Password) { FTP.Password = tempPwd; FTP.SaveLoinInfo(); } EditorTools.BeginContents(false); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.cyan; GUILayout.Space(20f); if (GUILayout.Button("AssetBundle Upload to FTP")) { if (FTP.ftpAddress.Length < 10) { msg_log = "FtpServer Name - A minimum of 20 characters or more !"; } else if (FTP.Id.Length < 2) { msg_log = "FtpId Name - A minimum of 2 characters or more !"; } else if (FTP.Password.Length < 2) { msg_log = "FtpPassworkd Name - A minimum of 2 characters or more !"; } else { if (!FTP.FindFileFormFTPDirectory(EditorABSetting.strExportPath)) { FTP.MakeDirectoryFromFTP(EditorABSetting.strExportPath); } if (!FTP.FindFileFormFTPDirectory(EditorABSetting.emBuildTarget.ToString(), EditorABSetting.strExportPath + "/")) { FTP.MakeDirectoryFromFTP(EditorABSetting.strExportPath + "/" + EditorABSetting.emBuildTarget.ToString()); } FTP.UploadtoLocalDirectory(EditorABSetting.GetBuildExportFullPath(), EditorABSetting.strExportPath + "/" + EditorABSetting.emBuildTarget.ToString() + "/"); } } if (GUILayout.Button("Directory FTP")) { if (!FTP.FindFileFormFTPDirectory(EditorABSetting.strExportPath)) { FTP.MakeDirectoryFromFTP(EditorABSetting.strExportPath); } if (!FTP.FindFileFormFTPDirectory(EditorABSetting.emBuildTarget.ToString(), EditorABSetting.strExportPath + "/")) { FTP.MakeDirectoryFromFTP(EditorABSetting.strExportPath + "/" + EditorABSetting.emBuildTarget.ToString()); } ftp_filelist = FTP.FileListFormFTPDirectoryDetails2(EditorABSetting.GetBuildPipelineOutPath()); if (ftp_filelist != null) { ftpFiles = true; } else { ftpFiles = false; } } GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); EditorTools.EndContents(); GUILayout.BeginHorizontal(); GUILayout.Space(3f); GUILayout.BeginVertical(); mScroll = GUILayout.BeginScrollView(mScroll); if (EditorTools.DrawHeader("AssetBundle Local Files", true)) { DrawBundleLocalFiles(); } GUILayout.BeginHorizontal(); GUILayout.Label(" "); GUILayout.EndHorizontal(); if (ftp_filelist != null && EditorTools.DrawHeader("FTP Upload Files", false)) { DrawBundleFTPFileDetails(ftp_filelist); } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.Space(3f); GUILayout.EndHorizontal(); }
void TabMakerGUI() { InfoHeaderGUI(); //----------------------------- EditorTools.DrawHeader("Build Bundle", true); EditorTools.BeginContents(false); DrawSettingItem("Build Export Folder Name", ref EditorABSetting.strExportPath, EditorABSetting.DEF_EXPORT_PATH); GUILayout.BeginHorizontal(); BuildAssetBundleOptions emOpt = (BuildAssetBundleOptions)EditorTools.EnumPopup("BuildOptions", EditorABSetting.emBuildOptions, Color.green, false); if (emOpt != EditorABSetting.emBuildOptions) { EditorABSetting.emBuildOptions = emOpt; } EditorABSetting.eBUILDTARGET emTarget = (EditorABSetting.eBUILDTARGET)EditorTools.EnumPopup("BuildTarget", EditorABSetting.emBuildTarget, Color.green, false); if (emTarget != EditorABSetting.emBuildTarget) { EditorABSetting.emBuildTarget = emTarget; } GUILayout.EndHorizontal(); EditorTools.EndContents(); //----------------------------- EditorTools.DrawHeader("AssetBundle Maker", true); EditorTools.BeginContents(false); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.cyan; GUILayout.Space(20f); if (GUILayout.Button("Add AssetBundle Folder")) { msg_log = EditorABManager.MarkFolderInFiles(EditorUtility.OpenFolderPanel("Add a Assets", EditorABSetting.GetProjectPath() + "/Assets", "Select Folder")); GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); return; } if (GUILayout.Button("Add AssetBundle File")) { msg_log = EditorABManager.MarkInFile(EditorUtility.OpenFilePanel("Add a Assets", EditorABSetting.GetProjectPath() + "/Assets", "*.*")); GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); return; } GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); EditorTools.EndContents(); // 번들 리스트 채크. string[] all = AssetDatabase.GetAllAssetBundleNames(); EditorTools.DrawHeader("AssetBundle Build", true); EditorTools.BeginContents(false); if (all.Length > 0) { GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.magenta; GUILayout.Space(20f); if (GUILayout.Button("Export AssetBundles")) { EditorABSetting.CreateExoprtFolder(); CleanUnUsedBundleName(); BuildPipeline.BuildAssetBundles(EditorABSetting.GetBuildPipelineOutPath(), EditorABSetting.GetBuildPipelineOptions(), EditorABSetting.GetBuildPipelineTarget()); EditorABSetting.SaveConfigFile(); return; } GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); } EditorTools.EndContents(); // 번들 리스트 채크. if (all.Length > 0) { GUILayout.BeginHorizontal(); GUILayout.Space(3f); GUILayout.BeginVertical(); mScroll = GUILayout.BeginScrollView(mScroll); for (int i = 0; i < all.Length; i++) { string[] childs = AssetDatabase.GetAssetPathsFromAssetBundle(all[i]); if (DrawABList(i, all[i], childs.Length, false)) { for (int j = 0; j < childs.Length; j++) { GUILayout.Space(-1f); int highlight = (j % 2);// (selected == j); GUI.backgroundColor = highlight == 1 ? Color.white : new Color(0.6f, 0.6f, 0.6f); GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f)); GUI.backgroundColor = Color.white; GUILayout.Label(j.ToString(), GUILayout.Width(24f)); if (GUILayout.Button(childs[j], "OL TextField", GUILayout.Height(20f))) { msg_log = childs[j]; } GUILayout.EndHorizontal(); } } } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.Space(3f); GUILayout.EndHorizontal(); } }
public void DrawBlockPanel(BlockPanelData panel, int level, int fromQuadrant = -1) { for (int j = panel.buttons.Count; j < order.Length; j++) { panel.buttons.Add(null); } string panelTitle = level == 1 ? "Root Panel" : "Level " + level + " Panel"; if (EditorTools.DrawHeader(panelTitle)) { EditorTools.BeginContents(); for (int i = 0; i < order.Length; i++) { int quadrant = order[i]; string name = names[i]; if (EditorTools.DrawHeader(panelTitle + " -- " + names[quadrant] + " Button")) { EditorTools.BeginContents(); if (IsOppositeQuadrant(quadrant, fromQuadrant)) { EditorGUILayout.LabelField("Can not use"); } else { BlockButtonData button = panel.buttons[quadrant]; if (button == null) { if (GUILayout.Button("Create Button")) { button = new BlockButtonData(); panel.buttons[quadrant] = button; dirty = true; } } else { DrawBlockButton(button, quadrant, level); if (GUILayout.Button("Delete Button")) { panel.buttons[quadrant] = null; dirty = true; } } } EditorTools.EndContents(); } } if (GUI.changed) { dirty = true; } EditorTools.EndContents(); } }
private void DrawClipEventDetial(EditorClipEvent node) { EditorTools.BeginContents(false); var tempval = string.IsNullOrEmpty(node.name) ? AvatarClipEventType.Null.ToString() : node.name; AvatarClipEventType eventType = (AvatarClipEventType)System.Enum.Parse(typeof(AvatarClipEventType), tempval); // GUI.backgroundColor = Color.cyan; GUILayout.BeginHorizontal(); if (GUILayout.Button(EditorGUIUtility.IconContent("ViewToolOrbit"), GUILayout.Width(25), GUILayout.Height(14))) { if (selectClip != null) { EditorClipEvent target = selectClip.SetAtFirst(node); if (target != null) { SetSelectClipEvent(target); } this.Repaint(); } } GUI.backgroundColor = this.GetColorSet(eventType.ToString()); eventType = (AvatarClipEventType)EditorGUILayout.EnumPopup("", eventType, GUILayout.Height(16)); var scolor = GUI.backgroundColor; GUI.backgroundColor = Color.red; if (GUILayout.Button("x", GUILayout.Height(14), GUILayout.Width(20))) { if (selectClip != null) { selectClip.BeginChange(); selectClip.ListClipEvent.Remove(selectClipEvent); selectClip.EndChange(); this.ClearSelectClipEvent(); this.MarkModified(); if (selectListClipEvent.Count > 0) { mSelectClipEvent = selectListClipEvent[0]; } } } GUI.backgroundColor = scolor; GUILayout.EndHorizontal(); GUI.contentColor = Color.yellow; GUILayout.Label("事件描述: " + EditorActionClipTool.GetDeafultDesc(eventType.ToString())); GUI.contentColor = Color.white; GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.white; string param = node.GetParam("param"); if (param == "") { param = EditorActionClipTool.GetDefaultParams(eventType.ToString()); } if (GUILayout.Button("默认值")) { param = (EditorActionClipTool.GetDefaultParams(node.name)); } GUILayout.EndHorizontal(); GUILayout.Space(2); GUILayout.BeginHorizontal(); // GUI.backgroundColor = Color.clear; GUILayout.TextArea(EditorActionClipTool.GetDefaultDescParam(eventType.ToString()), GUILayout.Width(60)); // GUI.backgroundColor = Color.cyan; param = EditorGUILayout.TextArea(param); GUILayout.EndHorizontal(); EditorTools.EndContents(); if (GUI.changed) { node.name = eventType.ToString(); node["param"] = param; this.MarkModified(); } }
protected void DrawClipDetial() { if (selectClip == null) { return; } var clip = selectClip; GUILayout.BeginHorizontal(); GUI.backgroundColor = m_IsPreviewStyle ? Color.red : Color.green; if (GUILayout.Button(m_IsPreviewStyle ? "关闭预览编辑" : "打开预览编辑", GUILayout.Height(30))) { ChangePreviewDetialStyle(); } GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); if (EditorTools.DrawHeader("轨道属性", false, false)) { EditorTools.BeginContents(false); GUI.skin.label.alignment = TextAnchor.MiddleLeft; GUI.contentColor = Color.white; GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("节点名:", GUILayout.Width(50)); string node_name = EditorGUILayout.TextField(clip.name, GUILayout.MinWidth(30)); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("动作名:", GUILayout.Width(50)); string clipName = EditorGUILayout.TextField(clip.GetParam("clipName"), GUILayout.MinWidth(30)); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("默认长度"); float length = EditorGUILayout.FloatField(clip.GetParamFloat("length")); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("播放速度:"); float speed = EditorGUILayout.Slider("", clip.GetParamFloat("speed"), 0.0f, 5.0f); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("播放模式"); WrapMode wrapMode = (WrapMode)System.Enum.Parse(typeof(WrapMode), clip.GetParam("wrapMode", WrapMode.Once.ToString())); wrapMode = (WrapMode)EditorGUILayout.EnumPopup("", wrapMode, GUILayout.MinWidth(40)); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("混合模式"); var evcrossMode = clip.GetParam("crossMode", AnimatorClip.CrossMode.Direct.ToString()); AnimatorClip.CrossMode crossMode = (AnimatorClip.CrossMode)System.Enum.Parse(typeof(AnimatorClip.CrossMode), evcrossMode); crossMode = (AnimatorClip.CrossMode)EditorGUILayout.EnumPopup("", crossMode, GUILayout.MinWidth(40)); float fadeFactor = EditorGUILayout.FloatField("", clip.GetParamFloat("fadeFactor"), GUILayout.Width(40)); GUILayout.EndHorizontal(); GUILayout.Space(5); EditorGUILayout.LabelField(EditorActionClipTool.ActionExtraParam.desc); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.clear; string descParam = EditorActionClipTool.ActionExtraParam.descParam; GUILayout.TextArea(descParam, GUILayout.Width(60)); GUI.backgroundColor = Color.white; string param = GUILayout.TextArea(clip.GetParam("param")); GUILayout.EndHorizontal(); EditorTools.EndContents(); if (GUI.changed) { clip.name = node_name; clip["clipName"] = clipName; clip["speed"] = speed.ToString(); clip["length"] = length.ToString(); clip["param"] = param; clip["fadeFactor"] = fadeFactor.ToString(); clip["crossMode"] = crossMode.ToString(); clip["wrapMode"] = wrapMode.ToString(); this.MarkModified(); } } }
protected void Draw_MarkPoint() { AvatarController avatar = target as AvatarController; if (EditorTools.DrawHeader("角色挂点", false, false)) { EditorTools.BeginContents(false); if (GUILayout.Button("自动添加")) { if (AddToMarkPoint(avatar)) { EditorTools.SetDirty(avatar); return; } } GameObject Obj_markPoint_buffer = null; Obj_markPoint_buffer = (GameObject)EditorGUILayout.ObjectField("添加挂点", Obj_markPoint_buffer, typeof(GameObject), true); bool isExist = false; for (int k = 0; k < avatar.markPoint.listMarkPoint.Count; k++) { if (avatar.markPoint.listMarkPoint[k] == null) { avatar.markPoint.listMarkPoint.RemoveAt(k); k--; continue; } if (Obj_markPoint_buffer != null && avatar.markPoint.listMarkPoint[k] == Obj_markPoint_buffer) { isExist = true; } GUILayout.BeginHorizontal(); GUILayout.Space(6); GUI.backgroundColor = new Color(0.8f, 0.5f, 0); if (GUILayout.Button(avatar.markPoint.listMarkPoint [k].name, GUILayout.Width(150))) { EditorTools.PingObject(avatar.markPoint.listMarkPoint [k]); } GUI.backgroundColor = Color.red; if (GUILayout.Button("X", GUILayout.Width(20))) { //删除挂点 if (GUI.changed) { EditorTools.RegisterUndo("AvatarController Change", avatar); GameObject markPoint = avatar.markPoint.listMarkPoint[k]; avatar.markPoint.listMarkPoint.Remove(markPoint); EditorTools.SetDirty(avatar); k--; } } GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); } if (!isExist) { if (Obj_markPoint_buffer != null) { if (GUI.changed) { EditorTools.RegisterUndo("AvatarController Change", avatar); avatar.markPoint.listMarkPoint.Add((GameObject)Obj_markPoint_buffer); EditorTools.SetDirty(avatar); } } } GUI.backgroundColor = Color.white; EditorTools.EndContents(); } }
private void DrawClipDetial() { if (selectClip == null) { return; } var clip = selectClip; EditorTools.BeginContents(false); GUI.skin.label.alignment = TextAnchor.MiddleLeft; GUI.contentColor = Color.white; GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("表现名:", GUILayout.Width(50)); string node_name = EditorGUILayout.TextField(clip.name, GUILayout.MinWidth(30)); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("备注名:", GUILayout.Width(50)); string detialName = EditorGUILayout.TextField(clip.GetParam("detialName"), GUILayout.MinWidth(30)); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("循环播放:", GUILayout.Width(50)); bool loop = EditorGUILayout.Toggle(clip.GetParamBool("loop"), GUILayout.MinWidth(30)); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("播放时长:", GUILayout.Width(50)); float length = EditorGUILayout.FloatField(clip.GetParamFloat("length"), GUILayout.MinWidth(30)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.clear; GUILayout.Label("参数:", GUILayout.Width(50)); GUI.backgroundColor = Color.white; string param = GUILayout.TextArea(clip.GetParam("param")); GUILayout.EndHorizontal(); EditorTools.EndContents(); if (GUI.changed) { clip.name = node_name; clip["detialName"] = detialName; clip["length"] = length.ToString(); clip["param"] = param; clip["loop"] = loop.ToString(); this.MarkModified(); } }
public void draw(UILabel uilabel) { if (uilabel.raycastTarget) { string eventTrigger = EditorGUILayout.TextField("点击事件", uilabel.ePressClick); string EventClickTriggerParam = EditorGUILayout.TextField("事件参数", uilabel.eParam); if (GUI.changed) { uilabel.ePressClick = eventTrigger; uilabel.eParam = EventClickTriggerParam; } } //GUILayout.Space (10); EditorTools.BeginContents(false); //Vector2 mPreferredOffset = uilabel.preferredOffset; //bool mUsePreferredWidth = EditorGUILayout.Toggle ("自适应宽度",uilabel.usePreferredWidth); //bool mUsePreferredHeight = EditorGUILayout.Toggle ("自适应高度",uilabel.usePreferredHeight); //if (mUsePreferredHeight || mUsePreferredWidth) { // mPreferredOffset = EditorGUILayout.Vector2Field ("自适应偏移",uilabel.preferredOffset); //} bool outline = EditorGUILayout.Toggle("Outline", uilabel.outline); Vector4 outlineParam = uilabel.outlineParam; Color outlineColor = GHelper.UF_IntToColor(uilabel.outlineColor); if (outline) { EditorGUILayout.BeginHorizontal(); outlineParam = EditorGUILayout.Vector4Field("", uilabel.outlineParam); outlineColor = EditorGUILayout.ColorField(outlineColor); EditorGUILayout.EndHorizontal(); GUILayout.Space(5); } if (outline && !uilabel.supportRichText) { EditorGUILayout.HelpBox("Global Outline Need To Support Rich Text", MessageType.Warning); } bool shadow = EditorGUILayout.Toggle("Shadow", uilabel.shadow); Vector2 shadowParam = uilabel.shadowParam; Color shadowColor = GHelper.UF_IntToColor(uilabel.shadowColor); if (shadow) { EditorGUILayout.BeginHorizontal(); shadowParam = EditorGUILayout.Vector2Field("", uilabel.shadowParam); shadowColor = EditorGUILayout.ColorField(shadowColor); EditorGUILayout.EndHorizontal(); } if (shadow && !uilabel.supportRichText) { EditorGUILayout.HelpBox("Global Shadow Need To Support Rich Text", MessageType.Warning); } EditorTools.EndContents(); if (GUI.changed) { EditorTools.RegisterUndo("UILabel", uilabel); //uilabel.usePreferredWidth = mUsePreferredWidth; //uilabel.usePreferredHeight = mUsePreferredHeight; uilabel.outline = outline; uilabel.outlineParam = outlineParam; uilabel.outlineColor = GHelper.UF_ColorToInt(outlineColor); uilabel.shadow = shadow; uilabel.shadowParam = shadowParam; uilabel.shadowColor = GHelper.UF_ColorToInt(shadowColor); EditorTools.SetDirty(uilabel); uilabel.SetVerticesDirty(); // uilabel.Refresh (); return; } }
void TabFileGUI() { EditorTools.DrawHeader("Info", true); EditorTools.BeginContents(false); GUI.contentColor = Color.green; GUILayout.Label("\u25BA Absolute Project Path > " + DBTableSetting.GetProjectPath()); GUILayout.Label("\u25BA Absolute Backup Path > " + DBTableSetting.GetBackupFullPath()); GUI.contentColor = Color.white; EditorTools.EndContents(); EditorTools.DrawHeader(DBTableSetting.strFileName, true); EditorTools.BeginContents(false); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.cyan; GUILayout.Space(20f); if (GUILayout.Button("Load CSV File")) { if (sel_key != string.Empty) { EditorPrefs.SetBool(sel_key, false); // 펼쳐진 리스트 초기화. } DBTableSetting.OpenLoadCSVFile(); GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); return; } GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); EditorTools.EndContents(); if (DBTableSetting.IsLoadFile()) { GUILayout.BeginHorizontal(); GUI.contentColor = Color.cyan; GUILayout.Label("\u25BA Load Path > " + DBTableSetting.strLoadFullPath); GUILayout.EndHorizontal(); GUI.contentColor = Color.white; GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.red; GUILayout.Space(20f); if (GUILayout.Button("Save CSV File")) { DBTableSetting.SaveCSVFile(); } GUI.backgroundColor = Color.white; if (GUILayout.Button("Clean List")) { DBTableSetting.DeletePrefs(); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); return; } GUILayout.Space(20f); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.green; GUILayout.Space(20f); if (GUILayout.Button("Make Struct")) { DBTableSetting.CreateStructClipboard(0); } if (GUILayout.Button("Make Load List Func")) { DBTableSetting.CreateParserListClipboard(0); } if (GUILayout.Button("Make Load Dictionary Func")) { DBTableSetting.CreateParserDictionaryClipboard(0); } GUI.backgroundColor = Color.white; GUILayout.Space(20f); GUILayout.EndHorizontal(); ShowListItems(DBTableSetting.grid); EditorTools.BeginContents(false); GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.cyan; GUILayout.Space(20f); if (GUILayout.Button(" < ")) { DBTableSetting.PagePrev(); } GUILayout.Toggle(true, DBTableSetting.GetCurrentPage(), "dragtab2", GUILayout.MaxWidth(70f)); if (GUILayout.Button(" > ")) { DBTableSetting.PageNext(); } GUILayout.Space(20f); GUI.backgroundColor = Color.white; GUILayout.EndHorizontal(); EditorTools.EndContents(); } }