public static CamShakeData Lerp(CamShakeData c0, CamShakeData c1, float t) { return(new CamShakeData( Mathf.Lerp(c0.magnitude, c1.magnitude, t), Mathf.Lerp(c0.roughness, c1.roughness, t), Mathf.Lerp(c0.fadeIn, c1.fadeIn, t), Mathf.Lerp(c0.fadeOut, c1.fadeOut, t))); }
public override void EnterState(Entity entity) { //freeze the entity if (entity.EntitySpriteObject != null) { originalPosition = entity.EntitySpriteObject.transform.position; } entity.Constraint(RigidbodyConstraints2D.FreezeAll); //GET IMPACT HERE TO SCALE CAM SHAKE+HITSTOP if (Receiving) { entity.Flash(); hitStopMagnitude = Vector2.Lerp(baseHitStopMagnitude, maxHitStopMagnitude, Power); CamShakeData.Lerp(baseCamShake, maxCamShake, Power).Shake(); } }