/// <summary> /// GUI绘制 /// </summary> void OnGUI() { Refresh(); scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(640), GUILayout.Height(800)); EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical("box", GUILayout.Width(400), GUILayout.Height(400)); #region ScrollView - Script Content EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(400), GUILayout.Height(400)); //GUIStyle style = new GUIStyle(GUI.skin.button); for (int i = 0; i < WorkingScriptContent.Count; i++) { var index = i; if (selectScriptContentIndex == index) { GUI.color = Color.green; } if (GUILayout.Button(WorkingScriptContent[index])) { selectScriptContentIndex = index; selectDataContentIndex = -1; } GUI.color = Color.white; } EditorGUILayout.EndScrollView(); #endregion #region ScrollView - Data Content EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(400), GUILayout.Height(800)); //GUIStyle style = new GUIStyle(GUI.skin.button); for (int i = 0; i < dataContent.Count; i++) { int index = i; if (selectDataContentIndex == index) { GUI.color = Color.cyan; } if (GUILayout.Button(dataContent[index])) { selectDataContentIndex = index; selectScriptContentIndex = -1; } GUI.color = Color.white; } EditorGUILayout.EndScrollView(); #endregion EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("box", GUILayout.Width(200), GUILayout.Height(440)); #region UI Num = EditorGUILayout.IntField("script ID:", Num); if (GUILayout.Button("输入ID加载脚本")) { LoadScript(); } if (GUILayout.Button("保存脚本")) { SaveScript(); } if (GUILayout.Button("创建新脚本")) { ClearContent(); } if (GUILayout.Button("删除行")) { DeleteContent(); } if (GUILayout.Button("上移")) { MoveUpContent(); } if (GUILayout.Button("下移")) { MoveDownContent(); } #region Add Trigger EditorGUILayout.BeginVertical("box"); GUI.color = Color.yellow; // 获取的实例 SkillTriggerScriptEditor.WinType = 1; SkillTriggerScriptEditor.GetIns(); if (GUILayout.Button("子级左括号")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.LeftBracket, this.position); } if (GUILayout.Button("子级右括号")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.RightBracket, this.position); } if (GUILayout.Button("点对点特效")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.PointToPoint, this.position); } if (GUILayout.Button("点对对象特效(跟踪)")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.PointToObj, this.position); } if (GUILayout.Button("点特效")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Point, this.position); } if (GUILayout.Button("连线特效")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Liner, this.position); } if (GUILayout.Button("范围碰撞检测")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.CollisionDetection, this.position); } if (GUILayout.Button("滑动碰撞检测")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.SlideCollisionDetection, this.position); } if (GUILayout.Button("音效")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Audio, this.position); } if (GUILayout.Button("Buff")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Buff, this.position); } if (GUILayout.Button("清除Buff")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.CleanBuff, this.position); } if (GUILayout.Button("删除指定Buff")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.DelBuff, this.position); } if (GUILayout.Button("Skill")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Skill, this.position); } if (GUILayout.Button("If")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.If, this.position); } if (GUILayout.Button("伤害/治疗结算")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.HealthChange, this.position); } if (GUILayout.Button("秒杀")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Death, this.position); } if (GUILayout.Button("伤害吸收")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.ResistDemage, this.position); } if (GUILayout.Button("免疫伤害")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.ImmuneDemage, this.position); } if (GUILayout.Button("免疫致死")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.ImmuneDeath, this.position); } if (GUILayout.Button("受到伤害上限")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.UpperLimit, this.position); } if (GUILayout.Button("吸血")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.LifeDrain, this.position); } if (GUILayout.Button("分担伤害")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.ShareDamage, this.position); } if (GUILayout.Button("移动")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Move, this.position); } if (GUILayout.Button("范围持续技")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Remain, this.position); } if (GUILayout.Button("目标点选择")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.TargetPointSelector, this.position); } if (GUILayout.Button("清除攻击目标")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.CleanTarget, this.position); } if (GUILayout.Button("循环")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.For, this.position); } if (GUILayout.Button("减技能CD")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.SubCD, this.position); } if (GUILayout.Button("召唤")) { SkillTriggerScriptEditor.ShowTriggerScriptWindow(this, TriggerType.Summoned, this.position); } GUI.color = Color.white; EditorGUILayout.EndVertical(); #endregion #region Data // 技能 EditorGUILayout.BeginVertical("box"); GUI.color = Color.green; if (GUILayout.Button("技能名称")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.SkillName, this.position); } if (GUILayout.Button("技能等级数据")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.LevelData, this.position); } if (GUILayout.Button("技能CD值")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.CDTime, this.position); } if (GUILayout.Button("技能CD组")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.CDGroup, this.position); } if (GUILayout.Button("技能可释放次数(持续技能)")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.ReleaseTime, this.position); } if (GUILayout.Button("触发事件Level1")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.TriggerLevel1, this.position); } if (GUILayout.Button("触发事件Level2")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.TriggerLevel2, this.position); } if (GUILayout.Button("触发概率")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.TriggerProbability, this.position); } if (GUILayout.Button("数据修正")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.ChangeData, this.position); } if (GUILayout.Button("技能是否为主动技能(默认否)")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.IsActive, this.position); } if (GUILayout.Button("技能描述")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.Description, this.position); } if (GUILayout.Button("技能Icon路径")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.Icon, this.position); } if (GUILayout.Button("技能执行间隔(持续技能)")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.IntervalTime, this.position); } if (GUILayout.Button("生命值区间下限(触发条件)")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.HpScopeMin, this.position); } if (GUILayout.Button("生命值区间上限(触发条件)")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.HpScopeMax, this.position); } if (GUILayout.Button("伤害增强/减免")) { SkillTriggerScriptEditor.ShowDataScriptWindow(this, (int)SkillDataType.DemageChange, this.position); } EditorGUILayout.EndVertical(); #endregion #endregion EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndScrollView(); }
public static void GetIns() { TriggerScriptEditor = new SkillTriggerScriptEditor(); }