Пример #1
0
    public void AddSpurtEvent(AnimationState state, float triggerTime,
                              float spurtSpeed, float beforeTime, float spurtTime, float afterTime, string funcName, bool visible = true, float beforeSpeed = 0, float afterSpeed = 0, bool stopFrame = true)
    {
        AnimationEventWrapper e = new AnimationEventWrapper();

        e.animType = AnimationEventType.eMove;

        e.animState       = state;
        e.animationName   = state.name;
        e.triggerTime     = triggerTime;
        e.functionName    = funcName;
        e.floatParameter  = spurtSpeed;
        e.floatParameter2 = spurtTime;
        e.floatParameter3 = beforeTime;
        e.floatParameter4 = afterTime;
        e.floatParameter5 = beforeSpeed;
        e.floatParameter6 = afterSpeed;

        e.boolParameter  = visible;
        e.boolParameter2 = stopFrame;

        if (!animationEvents.ContainsKey(state.name))
        {
            animationEvents[state.name] = new List <AnimationEventWrapper>();
        }
        animationEvents[state.name].Add(e);
    }
Пример #2
0
    //isFree表示是否独立于施法单位
    public void AddEffectEvent(AnimationState state, float triggerTime, string effectRes, string root, bool isDetach, float duration, float delayDestroy,
                               Vector3 pos, Vector3 rotation, Vector3 scale, string funcName)
    {
        AnimationEventWrapper e = new AnimationEventWrapper();

        e.animType = AnimationEventType.eEffect;

        e.animState       = state;
        e.animationName   = state.name;
        e.triggerTime     = triggerTime;
        e.stringParameter = effectRes;
        e.functionName    = funcName;
        e.floatParameter  = duration;
        e.floatParameter2 = delayDestroy;
        e.boolParameter   = isDetach;
        e.objectParameter = root;

        e.vector3Parameter  = pos;
        e.vector3Parameter2 = rotation;
        e.vector3Parameter3 = scale;

        if (!animationEvents.ContainsKey(state.name))
        {
            animationEvents[state.name] = new List <AnimationEventWrapper>();
        }
        animationEvents[state.name].Add(e);
    }
Пример #3
0
 public void ResetBodyAnim(Animation anim)
 {
     foreach (KeyValuePair <string, List <AnimationEventWrapper> > kv in animationEvents)
     {
         for (int i = 0; i < kv.Value.Count; i++)
         {
             AnimationEventWrapper evt = kv.Value[i];
             if (anim.GetClip(evt.animationName))
             {
                 evt.animState = anim[evt.animationName];
             }
         }
     }
 }
Пример #4
0
    public void AddSoundEvent(AnimationState state, float triggerTime, string soundRes, string funcName)
    {
        AnimationEventWrapper e = new AnimationEventWrapper();

        e.animType = AnimationEventType.eSound;

        e.animState       = state;
        e.animationName   = state.name;
        e.triggerTime     = triggerTime;
        e.stringParameter = soundRes;
        e.functionName    = funcName;

        if (!animationEvents.ContainsKey(state.name))
        {
            animationEvents[state.name] = new List <AnimationEventWrapper>();
        }
        animationEvents[state.name].Add(e);
    }
Пример #5
0
    public void AddShakeEvent(AnimationState state, float triggerTime, float duration, float shakeRange, string funcName)
    {
        AnimationEventWrapper e = new AnimationEventWrapper();

        e.animType = AnimationEventType.eShake;

        e.animState      = state;
        e.animationName  = state.name;
        e.triggerTime    = triggerTime;
        e.functionName   = funcName;
        e.floatParameter = duration;
        e.floatParameter = shakeRange;

        if (!animationEvents.ContainsKey(state.name))
        {
            animationEvents[state.name] = new List <AnimationEventWrapper>();
        }
        animationEvents[state.name].Add(e);
    }