Esempio n. 1
0
    protected override void OnUpdate(SkillCaller caller, Skill skill, int time)
    {
        float factor = 0;

        if (duration > 0)
        {
            factor = ((float)time) / duration;
        }
        path.UpdatePath(transform, factor);
    }
Esempio n. 2
0
 public override void UpdateTime(GameObject actor, float runningTime, float deltaTime)
 {
     if (EffectObj != null)
     {
         float factor = 0;
         if (duration > 0)
         {
             factor = ((float)runningTime) / duration;
         }
         if (path != null)
         {
             if (path is FollowSkillPath)
             {
                 FollowSkillPath fpath = (FollowSkillPath)path;
                 if (fpath.targetType == FollowTargetType.SELF)
                 {
                     fpath.targetObj = actor.transform;
                 }
             }
             path.UpdatePath(EffectObj.transform, factor);
         }
         if (ParticleRoot == null)
         {
             ParticleRoot = EffectObj.transform;
         }
         if (ParticleSys != null)
         {
             for (int i = 0; i < ParticleSys.Length; i++)
             {
                 UnityEditor.SceneView.RepaintAll();
                 System.Type t  = System.Type.GetType("UnityEditor.GameView,UnityEditor.dll");
                 var         mm = t.GetMethod("RepaintAll", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
                 mm.Invoke(null, null);
                 ParticleSys[i].Simulate(deltaTime, true, false);
             }
         }
     }
 }