public void OnGUI() { EditorGUILayout.LabelField("标记索引", FlagIndex.ToString()); TargetType = (eTargetType)EditorGUILayout.EnumPopup("目标类型", TargetType); AutoDestroy = EditorGUILayout.Toggle("是否自动销毁", AutoDestroy); DummyPoint = (eAvatarType)EditorGUILayout.EnumPopup("骨骼点", DummyPoint); EditorGUILayout.BeginHorizontal(); EffectPrefab = EditorGUILayout.TextField("特效预设路径", EffectPrefab); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { EffectPrefab = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EffectType = (eEffectType)EditorGUILayout.EnumPopup("特效类型", EffectType); Scale = EditorGUILayout.FloatField("特效缩放", Scale); ScaleApplyModel = EditorGUILayout.Toggle("特效是否随模型缩放比", ScaleApplyModel); OffsetPos = EditorGUILayout.Vector3Field("特效位置偏移", OffsetPos); OffsetRotate = EditorGUILayout.Vector3Field("特效旋转偏移", OffsetRotate); DelayDestroyTime = EditorGUILayout.FloatField("延迟销毁", DelayDestroyTime); if (EffectType == eEffectType.Bullet || EffectType == eEffectType.Trace) { Speed = EditorGUILayout.FloatField("速度", Speed); } if (EffectType == eEffectType.Attach) { OnlyTranslate = EditorGUILayout.Toggle("attach特效是否只位置改变", OnlyTranslate); } RotateToAttacker = EditorGUILayout.Toggle("是否朝向释放者", RotateToAttacker); if (EffectType == eEffectType.Bullet) { LifeTime = EditorGUILayout.FloatField("子弹生命时间", LifeTime); } if (EffectType == eEffectType.Bullet || EffectType == eEffectType.Trace) { EditorGUILayout.BeginHorizontal(); ArrivedInstance = EditorGUILayout.TextField("击中目标实例预设", ArrivedInstance); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开击中目标实例预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { ArrivedInstance = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); } if (EffectType == eEffectType.Trace) { TraceType = (eTraceType)EditorGUILayout.EnumPopup("追踪特效类型", TraceType); TraceDummyPoint = (eAvatarType)EditorGUILayout.EnumPopup("追踪特效打击骨骼点", TraceDummyPoint); TraceOffsetLen = EditorGUILayout.FloatField("抛物线偏移距离", TraceOffsetLen); TraceOffsetAngle = EditorGUILayout.FloatField("抛物线偏移角度", TraceOffsetAngle); FactorVal = EditorGUILayout.FloatField("抛物线计算因子", FactorVal); TraceOffsetStandDis = EditorGUILayout.FloatField("抛物线参考距离", TraceOffsetStandDis); } if (EffectType == eEffectType.Bullet) { BulletACross = EditorGUILayout.Toggle("子弹是否穿越", BulletACross); BulletDamageWidth = EditorGUILayout.FloatField("子弹穿越伤害宽度", BulletDamageWidth); } if (EffectType == eEffectType.Boomerang) { // Target = GlobalData.TargetType.TargetType_None; Speed = EditorGUILayout.FloatField("速度", Speed); OnceTime = EditorGUILayout.FloatField("抵达折返点时间", OnceTime); BackToAttaker = EditorGUILayout.Toggle("返回到角色", BackToAttaker); BooDamageWidth = EditorGUILayout.FloatField("回旋镖穿越伤害宽度", BooDamageWidth); } if (EffectType == eEffectType.Bounce) { Speed = EditorGUILayout.FloatField("速度", Speed); BounceTimes = EditorGUILayout.IntField("最大弹跳次数", BounceTimes); BounceDistance = EditorGUILayout.FloatField("最大弹跳距离", BounceDistance); } if (EffectType == eEffectType.Thunder) { Speed = EditorGUILayout.FloatField("速度", Speed); TraceDummyPoint = (eAvatarType)EditorGUILayout.EnumPopup("链接目标骨骼点", TraceDummyPoint); EditorGUILayout.BeginHorizontal(); ThunderPrefab = EditorGUILayout.TextField("链条特效预设路径", ThunderPrefab); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { ThunderPrefab = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } if (EffectType == eEffectType.Laser) { LaserMaxLength = EditorGUILayout.FloatField("激光束最大长度", LaserMaxLength); LaserStartWidth = EditorGUILayout.FloatField("激光束开始宽度", LaserStartWidth); LaserEndWidth = EditorGUILayout.FloatField("激光束结束宽度", LaserEndWidth); LaserCalcDamageTime = EditorGUILayout.FloatField("激光束计算伤害时间间隔", LaserCalcDamageTime); EditorGUILayout.BeginHorizontal(); LaserHeadEffect = EditorGUILayout.TextField("激光头特效", LaserHeadEffect); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { LaserHeadEffect = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); LaserTailEffect = EditorGUILayout.TextField("激光尾特效", LaserTailEffect); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { LaserTailEffect = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); } EditorGUILayout.Space(); }
void StopTrace(eTraceType _type) { switch(_type) { case eTraceType.SINGLE: StopCoroutine("StartDragTrace"); break; case eTraceType.DOUBLE: StopCoroutine("StartShakeTrace"); break; } m_TraceBegan = false; }