Пример #1
0
 public override void SetData(object[] data)
 {
     Target       = (Transform)data[0];
     TargetObject = (GameObject)data[1];
     skillunit    = (JSkillUnit)data[2];
     effectunit   = (SkillEffectUnit)data[3];
 }
Пример #2
0
        public SkillEffectUnit Copy()
        {
            SkillEffectUnit b = new SkillEffectUnit();

            b.configure = configure.Copy();
            b.artEffect = artEffect.Copy();
            return(b);
        }
 private void OnEnable()
 {
     if (skillunit == null)
     {
         skillunit = new JSkillUnit();
     }
     if (effectunit == null)
     {
         effectunit = new SkillEffectUnit();
     }
 }
Пример #4
0
        public static void ConvertSkillArt(SkillArt oUnit, SkillUnit.SkillArt unit)
        {
            oUnit.id            = unit.id;
            oUnit.guideAction   = unit.guideAction;
            oUnit.guideFadeTime = unit.guideFadeTime;
            oUnit.guidingAction = unit.guidingAction;
            oUnit.endAction     = unit.endAction;
            if (oUnit.unitEffect == null)
            {
                oUnit.unitEffect = new List <SkillEffectUnit>();
            }
            if (oUnit.tipEffect == null)
            {
                oUnit.tipEffect = new List <SkillEffectUnit>();
            }
            if (oUnit.hitEffect == null)
            {
                oUnit.hitEffect = new List <SkillEffectUnit>();
            }

            if (oUnit.unitEffect.Count == 0)
            {
                oUnit.unitEffect.Add(new SkillEffectUnit());
            }
            if (oUnit.tipEffect.Count == 0)
            {
                oUnit.tipEffect.Add(new SkillEffectUnit());
            }
            if (oUnit.hitEffect.Count == 0)
            {
                oUnit.hitEffect.Add(new SkillEffectUnit());
            }
            ConvertSkillArtEffect(oUnit.unitEffect[0].artEffect, unit.unitEffect);
            ConvertSkillArtEffect(oUnit.tipEffect[0].artEffect, unit.tipEffect);
            ConvertSkillArtEffect(oUnit.hitEffect[0].artEffect, unit.hitEffect);
            if (oUnit.beginEffect == null)
            {
                oUnit.beginEffect = new List <SkillEffectUnit>();
            }
            oUnit.beginEffect.Clear();
            for (int i = 0; i < unit.beginEffect.Count; i++)
            {
                SkillEffectUnit Effect = new SkillEffectUnit();
                ConvertSkillArtEffect(Effect.artEffect, unit.beginEffect[i]);
                oUnit.beginEffect.Add(Effect);
            }
        }
Пример #5
0
        public static SkillArt ConvertSkillArt(SkillUnit.SkillArt unit)
        {
            SkillArt oUnit = new SkillArt();

            oUnit.id            = unit.id;
            oUnit.guideAction   = unit.guideAction;
            oUnit.guideFadeTime = unit.guideFadeTime;
            oUnit.guidingAction = unit.guidingAction;
            oUnit.endAction     = unit.endAction;

            oUnit.unitEffect = new List <SkillEffectUnit>();
            oUnit.unitEffect.Add(new SkillEffectUnit());
            oUnit.unitEffect[0].artEffect = ConvertSkillArtEffect(unit.unitEffect);

            oUnit.tipEffect = new List <SkillEffectUnit>();
            oUnit.tipEffect.Add(new SkillEffectUnit());
            oUnit.tipEffect[0].artEffect = ConvertSkillArtEffect(unit.tipEffect);

            oUnit.hitEffect = new List <SkillEffectUnit>();
            oUnit.hitEffect.Add(new SkillEffectUnit());
            oUnit.hitEffect[0].artEffect = ConvertSkillArtEffect(unit.hitEffect);

            oUnit.beginCameraAction = new List <SkillCameraAction>();
            oUnit.beginCameraAction.Add(new SkillCameraAction());
            oUnit.beginCameraAction[0] = ConvertCameraAction(unit.beginCameraAction);

            oUnit.moveCameraAction = new List <SkillCameraAction>();
            oUnit.moveCameraAction.Add(new SkillCameraAction());
            oUnit.moveCameraAction[0] = ConvertCameraAction(unit.moveCameraAction);

            oUnit.hitCameraAction = new List <SkillCameraAction>();
            oUnit.hitCameraAction.Add(new SkillCameraAction());
            oUnit.hitCameraAction[0] = ConvertCameraAction(unit.hitCameraAction);

            oUnit.beginEffect = new List <SkillEffectUnit>();
            for (int i = 0; i < unit.beginEffect.Count; i++)
            {
                SkillEffectUnit Effect = new SkillEffectUnit();
                Effect.artEffect = ConvertSkillArtEffect(unit.beginEffect[i]);
                oUnit.beginEffect.Add(Effect);
            }

            return(oUnit);
        }
 //绘制特效列表
 public static void DrawEffectUnitList(List <SkillEffectUnit> beginEffect, Vector2 beginScrollPos, out Vector2 oScrollPos, float width, ref ReorderableList beginEffectList, List <string> Poplist, List <GameObject> Objlist)
 {
     EditorGUILayout.BeginVertical();
     //起手动作特效
     oScrollPos = EditorGUILayout.BeginScrollView(beginScrollPos);
     if (beginEffectList == null)
     {
         // 加入数据数组
         beginEffectList = new ReorderableList(beginEffect, typeof(SkillEffectUnit), false, false, true, true);
     }
     beginEffectList.elementHeight = 300;
     if (beginEffect == null || beginEffect.Count == 0)
     {
         beginEffectList.elementHeight = 20;
     }
     // 绘制Item显示列表
     beginEffectList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
     {
         SkillEffectUnit element  = (SkillEffectUnit)beginEffect[index];
         Rect            drawRect = new Rect(rect.x, rect.y + 20, width - 30, 300);
         GUILayout.BeginArea(drawRect);
         GUILayout.Label("index: " + index);
         EditorDrawUtility.DrawSkillEffectUnit(element, Poplist, Objlist);
         GUILayout.EndArea();
     };
     beginEffectList.onRemoveCallback = (ReorderableList l) =>
     {
         l.list.RemoveAt(l.index);
     };
     beginEffectList.onAddCallback = (ReorderableList l) =>
     {
         l.list.Add(new SkillEffectUnit());
     };
     beginEffectList.DoLayoutList();
     EditorGUILayout.EndScrollView();
     EditorGUILayout.EndVertical();
 }
 public override void SetData(object[] data)
 {
     EffectUnit   = (SkillEffectUnit)data[0];
     TargetObject = (GameObject)data[1];
 }
 //绘制特效单元
 public static void DrawSkillEffectUnit(SkillEffectUnit unit, List <string> Poplist = null, List <GameObject> Objlist = null)
 {
     DrawSkillArtEffect(unit.artEffect, Poplist, Objlist);
     DrawEffectConfigure(unit.configure);
 }
        public void AddClipWithName(string effectName, float startTime, float PlayBackduration, JSkillUnit unit, SkillEffectUnit effectUnit)
        {
            var clipData = ScriptableObject.CreateInstance <JTrajectoryClipData>();

            clipData.TargetObject     = TimeLine.AffectedObject.gameObject;
            clipData.StateName        = effectName;
            clipData.effectunit       = effectUnit;
            clipData.skillunit        = unit;
            clipData.StartTime        = startTime;
            clipData.PlaybackDuration = PlayBackduration;
            clipData.Track            = this;
            AddClip(clipData);
        }