Applies both force and torque to reduce both the linear and angular velocities to zero.

Inheritance: AnchoredJoint2D
Beispiel #1
0
 static public int get_maxTorque(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.FrictionJoint2D self = (UnityEngine.FrictionJoint2D)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.maxTorque);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.FrictionJoint2D o;
			o=new UnityEngine.FrictionJoint2D();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 static public int get_maxForce(IntPtr l)
 {
     try {
         UnityEngine.FrictionJoint2D self = (UnityEngine.FrictionJoint2D)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.maxForce);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #4
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.FrictionJoint2D o;
         o = new UnityEngine.FrictionJoint2D();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_maxTorque(IntPtr l)
 {
     try {
         UnityEngine.FrictionJoint2D self = (UnityEngine.FrictionJoint2D)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.maxTorque = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static void FrictionJoint2D_maxTorque(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.FrictionJoint2D _this = (UnityEngine.FrictionJoint2D)vc.csObj;
         var result = _this.maxTorque;
         JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
     }
     else
     {
         System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
         UnityEngine.FrictionJoint2D _this = (UnityEngine.FrictionJoint2D)vc.csObj;
         _this.maxTorque = arg0;
     }
 }
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.FrictionJoint2D frictionJoint2D = (UnityEngine.FrictionJoint2D)value;
     writer.WriteProperty("maxForce", frictionJoint2D.maxForce);
     writer.WriteProperty("maxTorque", frictionJoint2D.maxTorque);
     writer.WriteProperty("anchor", frictionJoint2D.anchor);
     writer.WriteProperty("connectedAnchor", frictionJoint2D.connectedAnchor);
     writer.WriteProperty("autoConfigureConnectedAnchor", frictionJoint2D.autoConfigureConnectedAnchor);
     writer.WriteProperty("connectedBody", frictionJoint2D.connectedBody);
     writer.WriteProperty("enableCollision", frictionJoint2D.enableCollision);
     writer.WriteProperty("breakForce", frictionJoint2D.breakForce);
     writer.WriteProperty("breakTorque", frictionJoint2D.breakTorque);
     writer.WriteProperty("enabled", frictionJoint2D.enabled);
     writer.WriteProperty("tag", frictionJoint2D.tag);
     writer.WriteProperty("name", frictionJoint2D.name);
     writer.WriteProperty("hideFlags", frictionJoint2D.hideFlags);
 }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.FrictionJoint2D frictionJoint2D = (UnityEngine.FrictionJoint2D)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "maxForce":
                    frictionJoint2D.maxForce = reader.ReadProperty <System.Single> ();
                    break;

                case "maxTorque":
                    frictionJoint2D.maxTorque = reader.ReadProperty <System.Single> ();
                    break;

                case "anchor":
                    frictionJoint2D.anchor = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "connectedAnchor":
                    frictionJoint2D.connectedAnchor = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "autoConfigureConnectedAnchor":
                    frictionJoint2D.autoConfigureConnectedAnchor = reader.ReadProperty <System.Boolean> ();
                    break;

                case "connectedBody":
                    if (frictionJoint2D.connectedBody == null)
                    {
                        frictionJoint2D.connectedBody = reader.ReadProperty <UnityEngine.Rigidbody2D> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Rigidbody2D> (frictionJoint2D.connectedBody);
                    }
                    break;

                case "enableCollision":
                    frictionJoint2D.enableCollision = reader.ReadProperty <System.Boolean> ();
                    break;

                case "breakForce":
                    frictionJoint2D.breakForce = reader.ReadProperty <System.Single> ();
                    break;

                case "breakTorque":
                    frictionJoint2D.breakTorque = reader.ReadProperty <System.Single> ();
                    break;

                case "enabled":
                    frictionJoint2D.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    frictionJoint2D.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    frictionJoint2D.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    frictionJoint2D.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
 /// <summary>
 /// Read the data using the reader.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public override object Read(ISaveGameReader reader)
 {
     UnityEngine.FrictionJoint2D frictionJoint2D = SaveGameType.CreateComponent <UnityEngine.FrictionJoint2D> ();
     ReadInto(frictionJoint2D, reader);
     return(frictionJoint2D);
 }