Exemplo n.º 1
0
    private Vector3 GetTorque(EDirectType asixType, float rotateAngle)
    {
        switch (asixType)
        {
        case EDirectType.DT_RelativeForward:
        case EDirectType.DT_SelfForward:
            return(rotateAngle * transform.forward);

        case EDirectType.DT_RelativeRight:
        case EDirectType.DT_SelfRight:
            return(rotateAngle * transform.right);

        case EDirectType.DT_RelativeUp:
        case EDirectType.DT_SelfUp:
            return(rotateAngle * transform.up);

        case EDirectType.DT_WorldForward:
            return(rotateAngle * Vector3.forward);

        case EDirectType.DT_WorldRight:
            return(rotateAngle * Vector3.right);

        case EDirectType.DT_WorldUp:
            return(rotateAngle * Vector3.up);
        }
        return(Vector3.zero);
    }
Exemplo n.º 2
0
 public FProjectileCurveData(EDirectType curveType, AnimationCurve curve, float curveScale, float flyTotalTime)
 {
     this.curve          = curve;
     this.curveType      = curveType;
     this.curveScale     = curveScale;
     this.curveSmoothing = curve.keys[curve.length - 1].time / flyTotalTime;
     this.curveTimer     = 0;
 }
Exemplo n.º 3
0
 public virtual void Reset()
 {
     bLookAt         = false;
     priority        = -1;
     directType      = EDirectType.DT_WorldForward;
     duration_Move   = 0.0f;
     duration_Rotate = 0.0f;
     velocity        = Vector3.zero;
     angularVelocity = Vector3.zero;
     motionType      = EMotionType.MT_Additive;
     rotateType      = EMotionType.MT_Additive;
 }
Exemplo n.º 4
0
 public void ApplyRotate(int priority, EMotionType rotateType, EDirectType asixType, float rotateAngle, float duration = 0.0f, AnimationCurve rotateCurve = null)
 {
     if (this.priority < priority)
     {
         Reset();
         OnMotionStart?.Invoke();
     }
     startTime_Rotate     = Time.time;
     this.priority        = priority;
     this.rotateType      = rotateType;
     this.torque          = GetTorque(asixType, rotateAngle);
     this.duration_Rotate = duration;
     this.rotateCurve     = rotateCurve;
 }
Exemplo n.º 5
0
    public AbilityBuffMotionModifiers(AbilitySystemComponent abilitySystem, Editor_FMotionModifierData data)
    {
        this.abilitySystem = abilitySystem;

        priority    = data.priority;
        duration    = data.duration;
        moveType    = data.moveType;
        distance    = data.distance;
        direction   = data.direction;
        rotateType  = data.rotateType;
        rotateAxis  = data.rotateAxis;
        rotateAngle = data.rotateAngle;
        moveCurve   = AnimationCurveManager.Instance.GetCurve(data.moveCurve);
        rotateCurve = AnimationCurveManager.Instance.GetCurve(data.rotateCurve);
    }
Exemplo n.º 6
0
 public void ApplyMotion(int priority, EMotionType motionType, EDirectType directType, float distance, float duration = 0.0f, AnimationCurve moveCurve = null)
 {
     if (this.priority < priority)
     {
         Reset();
         OnMotionStart?.Invoke();
     }
     startTime_Move     = Time.time;
     this.priority      = priority;
     this.motionType    = motionType;
     this.directType    = directType;
     this.direction     = GetDirection(directType);
     this.distance      = distance;
     this.duration_Move = duration;
     this.moveCurve     = moveCurve;
 }
Exemplo n.º 7
0
    Vector3 GetDirection(EDirectType directType)
    {
        switch (directType)
        {
        case EDirectType.DT_RelativeForward:
            return(transform.forward);

        case EDirectType.DT_RelativeRight:
            return(transform.right);

        case EDirectType.DT_RelativeUp:
            return(transform.up);

        case EDirectType.DT_WorldForward:
            return(Vector3.forward);

        case EDirectType.DT_WorldRight:
            return(Vector3.right);

        case EDirectType.DT_WorldUp:
            return(Vector3.up);
        }
        return(Vector3.zero);
    }
Exemplo n.º 8
0
 public void ApplyRotate(int priority, EMotionType rotateType, EDirectType asixType, float rotateAngle, float duration = 0.0f, AnimationCurve rotateCurve = null)
 {
     MotionClip.ApplyRotate(priority, rotateType, asixType, rotateAngle, duration, rotateCurve);
 }
Exemplo n.º 9
0
 public void ApplyMotion(int priority, EMotionType motionType, EDirectType directType, float distance, float duration = 0.0f, AnimationCurve moveCurve = null)
 {
     MotionClip.ApplyMotion(priority, motionType, directType, distance, duration, moveCurve);
 }