void changeGameObject(Rigidbody newBody) { GameObject oldPlanet = CurrentPlanet; CurrentPlanet = Instantiate(newBody, oldPlanet.transform.position, oldPlanet.transform.rotation) as GameObject; Camera.main.SendMessage ("changePlanet", CurrentPlanet.transform); Destroy (oldPlanet); }
void Start() { rb = GetComponent<Rigidbody>(); count = 0; SetCountText(); winText.text = ""; }
// Awake void Awake() { myRigidbody = GetComponent<Rigidbody>(); myRigidbody.maxAngularVelocity = 25f; myTransform = GetComponent<Transform>(); cameraTransform = Camera.main.GetComponent<Transform>(); }
// Use this for initialization void Start () { rb = GetComponent<Rigidbody>(); moveDirection.x = Random.Range(0, 360); moveDirection.z = Random.Range(0, 360); transform.eulerAngles = moveDirection; }
// Use this for initialization void Start() { IsTrapOn = false; pos = transform.position; myRigidbody = GetComponent<Rigidbody>(); rot = Vector3.zero; }
void Awake() { myTransform = GetComponent<Transform>(); myRigidBody = GetComponent<Rigidbody>(); myHealth = GetComponent<Health>(); BloodParticle = GetComponentInChildren<ParticleSystem>(); }
void Start() { rigidBody = GetComponent<Rigidbody>(); count = 0; SetCountText(); winText.text = string.Empty; }
// Use this for initialization void Awake() { player = GameObject.FindGameObjectWithTag ("Player").transform; playerOrgin = player.position; path2 = new []{ new Vector3(10.0f,20.0f,40f), new Vector3(10f,10f,20f), playerOrgin, new Vector3(0f,10f,-10f), new Vector3( 0f, -5f, -20f), new Vector3(10f,-10f,5f), new Vector3(5f,5f,15f), new Vector3(0f,20f,20f)}; path3 = new []{ new Vector3(30.0f,6.0f,60f), new Vector3(9f,40f,40f), new Vector3(15.2f,2f,20f), new Vector3(0f,0f,5f), new Vector3( 4f, 7f, -30f), new Vector3(16f,4f, 5f)}; path4 = new []{ new Vector3(20.0f,30.0f,60f), new Vector3(5f,70f,40f), new Vector3(28.2f,21f,20f), new Vector3(0f,0f,5f), new Vector3( 4f, 7f, -30f), new Vector3(16f,4f, 5f)}; path5 = new []{ new Vector3(20.0f,30.0f,60f), new Vector3(5f,-70f,30f), new Vector3(11.2f,16f,20f), new Vector3(0f,0f,5f), new Vector3( 4f, -17f, -30f), new Vector3(16f,4f, 5f)}; aiShip = FindObjectOfType <Rigidbody> (); launcher = GetComponent<MLauncher> (); path = path2; target = path[0]; bound = new Bounds (path[0], new Vector3(1f,1f,1f)); }
private void Awake() { floorMask = LayerMask.GetMask ("Floor"); anim = GetComponent <Animator> (); playerRigidbody = GetComponent <Rigidbody> (); mainCamera = GameObject.Find ("Main Camera 2").GetComponent<Camera>(); }
void Start() { OuterCollider = GetComponentInParent<Collider>(); if(OuterCollider == null) { Debug.Warning("level", "Hiding Place " + gameObject.name + " has no outer collider."); } HidingTrigger = GetComponent<Collider>(); if (HidingTrigger == null) { Debug.Warning("level", "Hiding Place " + gameObject.name + " has no inner trigger."); } else { if (!HidingTrigger.isTrigger) { HidingTrigger.isTrigger = true; } RBody = GetComponent<Rigidbody>(); if (RBody == null) { RBody = gameObject.AddComponent<Rigidbody>(); } RBody.isKinematic = true; RBody.useGravity = false; } }
void Start() { bullet = this.GetComponent<Rigidbody>(); bullet.AddForce(this.transform.forward * thrust); GameObject.Destroy(this.gameObject, 3.0f); }
void Awake() { floorMask = LayerMask.GetMask("Floor"); anim = GetComponent<Animator>(); pRigidBody = GetComponent<Rigidbody>(); }
void Start () { fRWheel = transform.FindChild("FR_Phys_Wheel").GetComponent<WheelController>(); fLWheel = transform.FindChild("FL_Phys_Wheel").GetComponent<WheelController>(); bRWheel = transform.FindChild("RR_Phys_Wheel").GetComponent<WheelController>(); bLWheel = transform.FindChild("RL_Phys_Wheel").GetComponent<WheelController>(); massCenterPosition = transform.FindChild("Mass_Center").localPosition; rb = GetComponent<Rigidbody>(); currentGear = 0; gearRatio = gearRatios[currentGear]; engineRpm = minRpm; centerToFrontWheels = GameObject.Find("F_Axel").GetComponent<Transform>().localPosition.z - massCenterPosition.z; centerToBackWheels = massCenterPosition.z - GameObject.Find("R_Axel").GetComponent<Transform>().localPosition.z; frontToBackWheels = centerToBackWheels + centerToFrontWheels; centerToLeftWheels = massCenterPosition.x - GameObject.Find("FL_Wheel").GetComponent<Transform>().localPosition.x; centerToRightWheels = GameObject.Find("FR_Wheel").GetComponent<Transform>().localPosition.x - massCenterPosition.x; leftToRightWheels = centerToRightWheels + centerToLeftWheels; velocity = new Vector3(); prevVelocity = velocity; aiController = GetComponent<AIInputController> (); }
// Use this for initialization void Start() { rb = GetComponent<Rigidbody> (); FindTarget (); InvokeRepeating ("FindTarget", 5.0F, 5.0F); InvokeRepeating ("FireMissileAtTarget", Random.Range (1.0f, 3.0f), 3.0f); }
protected int _timeToDie = 0; // Timer after _timeToLive goes negative before deactivation. public override void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager) { _interactionBehaviour = interactionBehaviour; _manager = manager; Revive(); _rigidbody = GetComponent<Rigidbody>(); }
// Use this for initialization void Start() { rb = GetComponent<Rigidbody> (); FindTarget (); InvokeRepeating ("FindTarget", 5.0F, 5.0F); Invoke ("Detonate", 5.0f); //Fall back, incase the missile doesnt stop }
void Start() { rb = GetComponent<Rigidbody> (); count = 0; result = 0; setResultText(); }
public void applyLinearForce(Rigidbody toBody, Vector3 desiredForce, bool relative) { if(relative) toBody.AddRelativeForce (desiredForce, this.forceMode); else toBody.AddForce (desiredForce, this.forceMode); }
void Awake() { m_myRigid = GetComponent<Rigidbody>(); m_anim = GetComponent<Animator>(); m_shipStates = GetComponent<StateManager>(); m_passTray = GetComponentInChildren<PassengerTray>(); }
void Start() { _t = transform; _animator = GetComponent<Animator>(); _controller = GetComponent<CharacterController>(); _rigidbody = GetComponent<Rigidbody>(); }
void Start() { activated = false; rb = GetComponent<Rigidbody> (); current = transform.position; current.y = maxHeight; }
void Start() { player = GameObject.FindWithTag ("Player").transform; pHealth = player.GetComponent<PlayerHealth> (); eHealth = GetComponent<EnemyHealth> (); Rigidbody = GetComponent<Rigidbody> (); }
// Use this for initialization void Start() { thisRidgedBody = this.GetComponent<Rigidbody>(); direction = transform.forward + transform.right; viewportPos = Camera.main.WorldToViewportPoint(this.transform.position); //this.transform.position += new Vector3(-0.2f, 0, 0); }
// Use this for initialization void Start() { // Script References shipGraphics = GetComponent<ShipGraphics>(); shipPhysicsScript = GetComponent<ShipPhysicsScript>(); // Component Variables cam = GetComponentInChildren<Camera>(); body = GetComponent<Rigidbody>(); model = transform.Find("Model").gameObject; capsuleCollider = GetComponentInChildren<CapsuleCollider>(); boxCollider = GetComponentInChildren<BoxCollider>(); lockSound = GetComponent<AudioSource>(); // Control Variables mouseSensitivity = 8.0f; //mouseThreshold = 8.0f; //buttonSensitivity = 0.05f; //buttonThreshold = 0.05f; horTranslation = 0.0f; verTranslation = 0.0f; enemyNoLock = (Material)Resources.Load("Crosshair"); enemyLock = (Material)Resources.Load("Crosshair_Enemy"); trackedObject = null; trackingResults = null; shootWaitTime = 0.0f; targetTime = 0.0f; hits = 0; }
// Use this for initialization void Start() { rb = GetComponent<Rigidbody>(); DontDestroyOnLoad(dLight); setCount(count); winText.text = ""; }
// Use this for initialization public void ManualStart() { _rigidbody = GetComponent<Rigidbody>(); _trail = GetComponent<TrailRenderer>(); _startTime = _trail.time; _gameObject = gameObject; }
// Update is called once per frame void Start() { robot = gameObject.GetComponent<Rigidbody>(); target = GameObject.FindGameObjectWithTag("plane11").transform; targetOriginal = GameObject.FindGameObjectWithTag("plane12").transform; flag = false; }
public void AddConnectedBody(Rigidbody rigidbody) { if (!connectedBodies.Contains(rigidbody)) { connectedBodies.Add(rigidbody); } }
void Start() { rigidBody = GetComponent<Rigidbody>(); wkDamage = 1; strDamage = 5; supstrDamage = 10; }
// Use this for initialization void Start () { ResetPosition = StartPosition; MoveDirection = transform.forward; EnemyRG = this.GetComponent<Rigidbody>(); }
static int WakeUp(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); obj.WakeUp(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int set_collisionDetectionMode(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.CollisionDetectionMode v; checkEnum(l, 2, out v); self.collisionDetectionMode = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int MoveRotation(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Quaternion a1; checkType(l, 2, out a1); self.MoveRotation(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
void Start() { this.rb = this.GetComponent <UnityEngine.Rigidbody>(); if (this.rb == null) { this.rb = this.gameObject.AddComponent <UnityEngine.Rigidbody>(); } this.rb.isKinematic = true; this.rb.useGravity = false; this.rb.constraints = UnityEngine.RigidbodyConstraints.FreezeRotationX | UnityEngine.RigidbodyConstraints.FreezeRotationZ; this.blocked = false; this.bgFunc = null; }
static public int set_constraints(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.RigidbodyConstraints v; checkEnum(l, 2, out v); self.constraints = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_angularVelocity(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Vector3 v; checkType(l, 2, out v); self.angularVelocity = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_maxDepenetrationVelocity(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); float v; checkType(l, 2, out v); self.maxDepenetrationVelocity = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int AddForce(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); obj.AddForce(arg0); return(0); } else if (count == 3) { UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.ForceMode arg1 = (UnityEngine.ForceMode)ToLua.CheckObject(L, 3, typeof(UnityEngine.ForceMode)); obj.AddForce(arg0, arg1); return(0); } else if (count == 4) { UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); obj.AddForce(arg0, arg1, arg2); return(0); } else if (count == 5) { UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); UnityEngine.ForceMode arg3 = (UnityEngine.ForceMode)ToLua.CheckObject(L, 5, typeof(UnityEngine.ForceMode)); obj.AddForce(arg0, arg1, arg2, arg3); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Rigidbody.AddForce")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int SetDensity(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); System.Single a1; checkType(l, 2, out a1); self.SetDensity(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_sleepThreshold(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); float v; checkType(l, 2, out v); self.sleepThreshold = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_interpolation(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.RigidbodyInterpolation v; checkEnum(l, 2, out v); self.interpolation = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_solverVelocityIterations(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); int v; checkType(l, 2, out v); self.solverVelocityIterations = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_detectCollisions(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); bool v; checkType(l, 2, out v); self.detectCollisions = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_inertiaTensorRotation(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Quaternion v; checkType(l, 2, out v); self.inertiaTensorRotation = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int SetDensity(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.SetDensity(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int QPYX_get_attachedRigidbody_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); UnityEngine.Collider QPYX_obj_YXQP = (UnityEngine.Collider)QPYX_o_YXQP; UnityEngine.Rigidbody QPYX_ret_YXQP = QPYX_obj_YXQP.attachedRigidbody; ToLua.PushSealed(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index attachedRigidbody on a nil value")); } }
static public int GetPointVelocity(IntPtr l) { try { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Vector3 a1; checkType(l, 2, out a1); var ret = self.GetPointVelocity(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static int MoveRotation(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); UnityEngine.Quaternion arg0 = ToLua.ToQuaternion(L, 2); obj.MoveRotation(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int IsSleeping(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); bool o = obj.IsSleeping(); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int SweepTestAll(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 4) { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Vector3 a1; checkType(l, 2, out a1); System.Single a2; checkType(l, 3, out a2); UnityEngine.QueryTriggerInteraction a3; checkEnum(l, 4, out a3); var ret = self.SweepTestAll(a1, a2, a3); pushValue(l, true); pushValue(l, ret); return(2); } else if (argc == 3) { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Vector3 a1; checkType(l, 2, out a1); System.Single a2; checkType(l, 3, out a2); var ret = self.SweepTestAll(a1, a2); pushValue(l, true); pushValue(l, ret); return(2); } else if (argc == 2) { UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l); UnityEngine.Vector3 a1; checkType(l, 2, out a1); var ret = self.SweepTestAll(a1); pushValue(l, true); pushValue(l, ret); return(2); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
static int GetPointVelocity(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody)); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.Vector3 o = obj.GetPointVelocity(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_angularVelocity(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; UnityEngine.Vector3 ret = obj.angularVelocity; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index angularVelocity on a nil value")); } }
static int get_collisionDetectionMode(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; UnityEngine.CollisionDetectionMode ret = obj.collisionDetectionMode; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index collisionDetectionMode on a nil value")); } }
static int get_worldCenterOfMass(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; UnityEngine.Vector3 ret = obj.worldCenterOfMass; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index worldCenterOfMass on a nil value")); } }
static int get_useConeFriction(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; bool ret = obj.useConeFriction; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index useConeFriction on a nil value")); } }
static int get_interpolation(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; UnityEngine.RigidbodyInterpolation ret = obj.interpolation; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index interpolation on a nil value")); } }
static int get_solverIterationCount(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; int ret = obj.solverIterationCount; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index solverIterationCount on a nil value")); } }
static int get_sleepVelocity(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)o; float ret = obj.sleepVelocity; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index sleepVelocity on a nil value")); } }
static int get_rigidbody(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.GameObject obj = (UnityEngine.GameObject)o; UnityEngine.Rigidbody ret = obj.rigidbody; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index rigidbody on a nil value")); } }
static int get_attachedRigidbody(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Collider obj = (UnityEngine.Collider)o; UnityEngine.Rigidbody ret = obj.attachedRigidbody; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index attachedRigidbody on a nil value" : e.Message)); } }