public Force(ForceTemplate template) { this.Name = template.Name == "" ? $"force" + Time.time : template.Name; this.ForceApplied = template.ForceToApply; this.ActualForce = template.ForceToApply; this.TimeToStop = template.TimeToStop; this.stopBehaviour = template.stopBehaviour; this.disableAllGravity = template.disableAllGravity; }
///<param name="name">Name of the force</param> ///<param name="force">Force to be applied</param> ///<param name="time">Time to the force stop</param> ///<param name="gravity">Should calculate gravity?</param> public Force(string name, Vector2 force, float time = 0, CollisionStopBehaviour stopBehaviour = CollisionStopBehaviour.DontStop, bool disableAllGravity = false) { this.Name = name; this.ForceApplied = force; this.ActualForce = force; this.TimeToStop = time; this.stopBehaviour = stopBehaviour; this.disableAllGravity = disableAllGravity; }