Наследование: Component
Пример #1
1
 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);
 }
Пример #2
1
 void Start()
 {
     rb = GetComponent<Rigidbody>();
     count = 0;
     SetCountText();
     winText.text = "";
 }
Пример #3
1
 // Awake
 void Awake()
 {
     myRigidbody = GetComponent<Rigidbody>();
     myRigidbody.maxAngularVelocity = 25f;
     myTransform = GetComponent<Transform>();
     cameraTransform = Camera.main.GetComponent<Transform>();
 }
Пример #4
1
	// 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;
 }
Пример #6
1
 void Awake()
 {
     myTransform = GetComponent<Transform>();
     myRigidBody = GetComponent<Rigidbody>();
     myHealth = GetComponent<Health>();
     BloodParticle = GetComponentInChildren<ParticleSystem>();
 }
Пример #7
1
	void Start()
	{
		rigidBody = GetComponent<Rigidbody>();
		count = 0;
		SetCountText();
		winText.text = string.Empty;
	}
Пример #8
1
    // 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>();
 }
Пример #10
1
    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;
        }
    }
Пример #11
1
    void Start()
    {
        bullet = this.GetComponent<Rigidbody>();
        bullet.AddForce(this.transform.forward *  thrust);

        GameObject.Destroy(this.gameObject, 3.0f);
    }
Пример #12
1
    void Awake()
    {
        floorMask = LayerMask.GetMask("Floor");

        anim = GetComponent<Animator>();
        pRigidBody = GetComponent<Rigidbody>();
    }
Пример #13
1
	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> ();
	}
Пример #14
1
 // 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);
 }
Пример #15
1
    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
 }
Пример #17
1
 void Start()
 {
     rb = GetComponent<Rigidbody> ();
     count = 0;
     result = 0;
     setResultText();
 }
Пример #18
1
 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>();
 }
Пример #21
1
 void Start()
 {
     activated = false;
     rb = GetComponent<Rigidbody> ();
     current = transform.position;
     current.y = maxHeight;
 }
Пример #22
1
 void Start()
 {
     player = GameObject.FindWithTag ("Player").transform;
     pHealth = player.GetComponent<PlayerHealth> ();
     eHealth = GetComponent<EnemyHealth> ();
     Rigidbody = GetComponent<Rigidbody> ();
 }
Пример #23
1
 // 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);
 }
Пример #24
1
    // 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;
    }
Пример #25
1
 // Use this for initialization
 void Start()
 {
     rb = GetComponent<Rigidbody>();
     DontDestroyOnLoad(dLight);
     setCount(count);
     winText.text = "";
 }
Пример #26
1
 // Use this for initialization
 public void ManualStart()
 {
     _rigidbody = GetComponent<Rigidbody>();
     _trail = GetComponent<TrailRenderer>();
     _startTime = _trail.time;
     _gameObject = gameObject;
 }
Пример #27
1
 // Update is called once per frame
 void Start()
 {
     robot = gameObject.GetComponent<Rigidbody>();
     target = GameObject.FindGameObjectWithTag("plane11").transform;
     targetOriginal = GameObject.FindGameObjectWithTag("plane12").transform;
     flag = false;
 }
Пример #28
1
 public void AddConnectedBody(Rigidbody rigidbody)
 {
     if (!connectedBodies.Contains(rigidbody))
     {
       connectedBodies.Add(rigidbody);
     }
 }
Пример #29
1
 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>();
	}
Пример #31
0
 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));
     }
 }
Пример #33
0
 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));
     }
 }
Пример #34
0
    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));
     }
 }
Пример #36
0
 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));
     }
 }
Пример #37
0
 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));
     }
 }
Пример #38
0
    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));
        }
    }
Пример #39
0
 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));
     }
 }
Пример #40
0
 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));
     }
 }
Пример #41
0
 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));
     }
 }
Пример #42
0
 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));
     }
 }
Пример #43
0
 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));
     }
 }
Пример #44
0
 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));
     }
 }
Пример #45
0
 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));
     }
 }
Пример #46
0
    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"));
        }
    }
Пример #47
0
 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));
     }
 }
Пример #48
0
 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));
     }
 }
Пример #49
0
 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));
     }
 }
Пример #50
0
 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));
     }
 }
Пример #51
0
 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));
     }
 }
Пример #52
0
    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"));
        }
    }
Пример #53
0
    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"));
        }
    }
Пример #54
0
    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"));
        }
    }
Пример #55
0
    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"));
        }
    }
Пример #56
0
    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"));
        }
    }
Пример #57
0
    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"));
        }
    }
Пример #58
0
    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"));
        }
    }
Пример #59
0
    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));
        }
    }