コード例 #1
0
        protected Force Target(ForceProps force, Vector3 direction)
        {
            Force out_ = GetForce(force);

            if (out_ == null)
            {
                out_ = new Force(force, direction);
                active_forces.Add(out_.properties.Name, out_);
            }

            return out_;
        }
コード例 #2
0
ファイル: Force.cs プロジェクト: xCosmix/Random_Project
        public Force(ForceProps props, Vector2 target_direction)
        {
            properties = props;

            Call(target_direction);
        }
コード例 #3
0
ファイル: Force.cs プロジェクト: xCosmix/Random_Project
        public Force(string id, Vector2 target_direction, float target_speed, float inertia_in = 1.0f, float inertia_out = 1.0f, float impulse = 0.0f)
        {
            properties = new ForceProps(id, target_speed, inertia_in, inertia_out, impulse);

            Call(target_direction);
        }
コード例 #4
0
 public Force GetForce(ForceProps force)
 {
     if (active_forces.ContainsKey(force.Name))
         return active_forces[force.Name];
     return null;
 }
コード例 #5
0
 public void AddForce(ForceProps forceProps, Vector3 direction)
 {
     Force target = Target(forceProps, direction);
     call_forces.Add(new Force2Call(direction, target));
 }