static public int get_relativeForce(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.ConstantForce2D self = (UnityEngine.ConstantForce2D)checkSelf(l); pushValue(l, true); pushValue(l, self.relativeForce); 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 }
/// <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.ConstantForce2D constantForce2D = (UnityEngine.ConstantForce2D)value; writer.WriteProperty("force", constantForce2D.force); writer.WriteProperty("relativeForce", constantForce2D.relativeForce); writer.WriteProperty("torque", constantForce2D.torque); writer.WriteProperty("enabled", constantForce2D.enabled); writer.WriteProperty("tag", constantForce2D.tag); writer.WriteProperty("name", constantForce2D.name); writer.WriteProperty("hideFlags", constantForce2D.hideFlags); }
static public int get_torque(IntPtr l) { try { UnityEngine.ConstantForce2D self = (UnityEngine.ConstantForce2D)checkSelf(l); pushValue(l, true); pushValue(l, self.torque); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { UnityEngine.ConstantForce2D o; o=new UnityEngine.ConstantForce2D(); pushValue(l,true); pushValue(l,o); return 2; } catch(Exception e) { return error(l,e); } }
static public int get_torque(IntPtr l) { try { UnityEngine.ConstantForce2D self = (UnityEngine.ConstantForce2D)checkSelf(l); pushValue(l, self.torque); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int constructor(IntPtr l) { try { UnityEngine.ConstantForce2D o; o = new UnityEngine.ConstantForce2D(); pushValue(l, o); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int constructor(IntPtr l) { try { UnityEngine.ConstantForce2D o; o = new UnityEngine.ConstantForce2D(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int set_torque(IntPtr l) { try { UnityEngine.ConstantForce2D self = (UnityEngine.ConstantForce2D)checkSelf(l); float v; checkType(l, 2, out v); self.torque = v; return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int set_torque(IntPtr l) { try { UnityEngine.ConstantForce2D self = (UnityEngine.ConstantForce2D)checkSelf(l); float v; checkType(l, 2, out v); self.torque = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static void ConstantForce2D_torque(JSVCall vc) { if (vc.bGet) { UnityEngine.ConstantForce2D _this = (UnityEngine.ConstantForce2D)vc.csObj; var result = _this.torque; JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result)); } else { System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); UnityEngine.ConstantForce2D _this = (UnityEngine.ConstantForce2D)vc.csObj; _this.torque = arg0; } }
static void ConstantForce2D_relativeForce(JSVCall vc) { if (vc.bGet) { UnityEngine.ConstantForce2D _this = (UnityEngine.ConstantForce2D)vc.csObj; var result = _this.relativeForce; JSApi.setVector2S((int)JSApi.SetType.Rval, result); } else { UnityEngine.Vector2 arg0 = (UnityEngine.Vector2)JSApi.getVector2S((int)JSApi.GetType.Arg); UnityEngine.ConstantForce2D _this = (UnityEngine.ConstantForce2D)vc.csObj; _this.relativeForce = arg0; } }
void Start() { body = GetComponent<Rigidbody2D>(); force = GetComponent<ConstantForce2D>(); float alpha = GameUtils.Instance.DegreeToRadian(transform.rotation.eulerAngles.z); force.force = new Vector2(maxForce * Mathf.Cos(alpha), maxForce * Mathf.Sin(alpha)); body.velocity = force.force; int rand = Random.Range(0, listParticle.Length); listParticle[rand].SetActive(true); particle = listParticle[rand].GetComponent<ParticleSystem>(); particle.Play(); SoundManager.Instance.playSound(ESound.Rocket); }
void Start () { body = GetComponent<Rigidbody2D>(); collider = GetComponent<Collider2D>(); force = GetComponent<ConstantForce2D>(); float alpha = GameUtils.Instance.DegreeToRadian(transform.rotation.eulerAngles.z); force.force = new Vector2(maxForce * Mathf.Cos(alpha), maxForce * Mathf.Sin(alpha)); body.velocity = force.force; // Network playerId = photonView.ownerId; radar.playerId = playerId; SoundManager.Instance.playSound(ESound.Fire); }
/// <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.ConstantForce2D constantForce2D = (UnityEngine.ConstantForce2D)value; foreach (string property in reader.Properties) { switch (property) { case "force": constantForce2D.force = reader.ReadProperty <UnityEngine.Vector2> (); break; case "relativeForce": constantForce2D.relativeForce = reader.ReadProperty <UnityEngine.Vector2> (); break; case "torque": constantForce2D.torque = reader.ReadProperty <System.Single> (); break; case "enabled": constantForce2D.enabled = reader.ReadProperty <System.Boolean> (); break; case "tag": constantForce2D.tag = reader.ReadProperty <System.String> (); break; case "name": constantForce2D.name = reader.ReadProperty <System.String> (); break; case "hideFlags": constantForce2D.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.ConstantForce2D constantForce2D = SaveGameType.CreateComponent <UnityEngine.ConstantForce2D> (); ReadInto(constantForce2D, reader); return(constantForce2D); }
void Awake() { cf = GetComponent<ConstantForce2D>(); cf.enabled = false; }
static int _CreateConstantForce2D(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { ConstantForce2D obj = new ConstantForce2D(); LuaScriptMgr.Push(L, obj); return 1; } else { LuaDLL.luaL_error(L, "invalid arguments to method: ConstantForce2D.New"); } return 0; }
// Use this for initialization void Start() { Player = GameObject.Find ("Player"); BarrelPivot = transform.FindChild ("BarrelPivot").gameObject; //get child GameObject BarrelPivot Barrel = BarrelPivot.transform.FindChild ("Barrel").gameObject; pivotForce = BarrelPivot.GetComponent<ConstantForce2D> (); //get ConstantForce2D on BarrelPivot pivotRB = BarrelPivot.GetComponent<Rigidbody2D> (); //get Rigidbody2D on BarrelPivot pivotForce.torque = -1 * initialTurnSpeed; //initial turret rotation //InvokeRepeating ("angleCap", 0, angleCheckRate); //firing setup if (homig) shotsperburst = 1; }
void Awake() { chassis = GetComponent<Rigidbody2D>(); force = GetComponent<ConstantForce2D>(); drag = chassis.drag; ChangeGear((int)currentGear); }