public static DMKCurveProperty Copy(DMKCurveProperty p) { DMKCurveProperty n = new DMKCurveProperty(); n.value = p.value; n.type = p.type; n.curve = DMKUtil.CopyCurve(p.curve); n.valEnd = p.valEnd; n.Update(0, true); return(n); }
public static DMKCurveProperty Copy(DMKCurveProperty p, float x) { DMKCurveProperty n = new DMKCurveProperty(); n.value = p.value * x; n.valEnd = p.valEnd * x; n.type = p.type; n.curve = DMKUtil.CopyCurve(p.curve, v => { return(v * x); }); n.currentVal = p.currentVal * x; return(n); }
public void CopyFrom(DMKBulletInfo prototype, float speedMultiplier = 1f) { this.bulletSprite = prototype.bulletSprite; this.damage = prototype.damage; this.speed = DMKCurveProperty.Copy(prototype.speed, speedMultiplier); this.accel = DMKCurveProperty.Copy(prototype.accel); this.angularAccel = DMKCurveProperty.Copy(prototype.angularAccel); this.bulletColor = prototype.bulletColor; this.died = false; this.useScaleCurve = prototype.useScaleCurve; this.scaleCurveX = DMKUtil.CopyCurve(prototype.scaleCurveX); this.scaleCurveY = DMKUtil.CopyCurve(prototype.scaleCurveY); this.collisionRect = prototype.collisionRect; this.maxLifetime = prototype.maxLifetime; this.lifeFrame = 0; }