Beispiel #1
0
        public Rotation(BaseEvent be, Character caster, Environment environment)
        {
            this.be          = be;
            this.caster      = caster;
            this.environment = environment;
            ra = (RotationAction)be.ShowAction();
            Entity entity = caster.GameObject().GetComponent <EntityReference>().Entity;

            movementComponent = entity.GetComponent <MovementComponent>();
            TimelineTrigger timelineTrigger = (TimelineTrigger)be.ShowTrigger();

            duration            = ra.ShowDurationInSeconds(timelineTrigger.ShowScaleTime());
            interpolationMethod = ra.ShowInterpolation();
            interpolator        = EasingFunctions.GetEasingFunction(interpolationMethod);
            movingDirection     = ra.ShowMovingDirection();
            mode = ra.mode.ShowRotationMode();
            switch (mode)
            {
            case RotationAction.RotationMode.Delta:
                deltaRotationMode = (RotationAction.DeltaRotationMode)ra.mode;
                break;

            case RotationAction.RotationMode.Destination:
                destinationRotationMode = (RotationAction.DestinationRotationMode)ra.mode;
                break;
            }
        }
Beispiel #2
0
        // Use this for initialization
        void Start()
        {
            _mpMotor = GetComponent <MovingPlatformMotor2D>();
            _mpMotor.onPlatformerMotorContact += PlayerContact;
            _originalY = transform.position.y;

            _moveUpFunc   = EasingFunctions.GetEasingFunction(moveUpEase);
            _moveDownFunc = EasingFunctions.GetEasingFunction(moveDownEase);
        }
        public static Quaternion Interpolate(Quaternion p, Quaternion q,
                                             EasingFunctions.EasingFunc f, float t,
                                             bool shortWay)
        {
            if (shortWay)
            {
                float dot = Quaternion.Dot(p, q);
                if (dot < 0.0f)
                {
                    return(Interpolate(ScalarMultiply(p, -1.0f), q, f, t, true));
                }
            }

            Quaternion r = Quaternion.identity;

            t   = f(0, 1, t);
            r.x = p.x * (1f - t) + q.x * (t);
            r.y = p.y * (1f - t) + q.y * (t);
            r.z = p.z * (1f - t) + q.z * (t);
            r.w = p.w * (1f - t) + q.w * (t);
            return(r);
        }
Beispiel #4
0
        public RagdollModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                               Camera camera, SkillId skillId, Environment environment,
                               CollectionOfInteractions modifierInteractionCollection,
                               WallHitConfig wallHitConfig, float damageScale,
                               ProjectileComponent projectile) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.casterEntity = casterEntity;
            this.targetEntity = targetEntity;
            this.camera       = camera;
            this.skillId      = skillId;
            this.environment  = environment;
            this.whc          = wallHitConfig;
            this.damageScale  = damageScale;
            this.projectile   = projectile;
            this.info         = (RagdollInfo)info;

            easingFunc = EasingFunctions.GetEasingFunction(EasingFunctions.Functions.EaseOutQuad);
            CalculateDurations(this.info);
            switch (this.info.RagdollModifierConfig.ShowAnimationProfile())
            {
            case BlastModifierConfig.AnimationProfile.Far:
                animProfile = new FarAnimProfile();
                break;

            case BlastModifierConfig.AnimationProfile.High:
                animProfile = new HighAnimProfile();
                break;

            case BlastModifierConfig.AnimationProfile.Medium:
                animProfile = new MediumAnimProfile();
                break;
            }
            targetCharacter = targetEntity.GetComponent <SkillComponent>().Character;
            StatsComponent casterStatsComponent = casterEntity.GetComponent <StatsComponent>();

            characterStats = casterStatsComponent.CharacterStats;
            //DLog.Log("RagdollModifier: state: " + state);
        }
 private void SetDashFunctions()
 {
     _dashFunction = EasingFunctions.GetEasingFunction(dashEasingFunction);
     _dashDerivativeFunction = EasingFunctions.GetEasingFunctionDerivative(dashEasingFunction);
     _currentDashEasingFunction = dashEasingFunction;
 }
Beispiel #6
0
        // Use this for initialization
        void Start()
        {
            _mpMotor = GetComponent<MovingPlatformMotor2D>();
            _mpMotor.onPlatformerMotorContact += PlayerContact;
            _originalY = transform.position.y;

            _moveUpFunc = EasingFunctions.GetEasingFunction(moveUpEase);
            _moveDownFunc = EasingFunctions.GetEasingFunction(moveDownEase);
        }
Beispiel #7
0
 private void SetDashFunctions()
 {
     _dashFunction              = EasingFunctions.GetEasingFunction(dashEasingFunction);
     _dashDerivativeFunction    = EasingFunctions.GetEasingFunctionDerivative(dashEasingFunction);
     _currentDashEasingFunction = dashEasingFunction;
 }