static void CollisionModule_maxPlaneCount(JSVCall vc)
    {
        UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
        var result = _this.maxPlaneCount;

        JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
    }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.ParticleSystem.CollisionModule o;
			o=new UnityEngine.ParticleSystem.CollisionModule();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.ParticleSystem.CollisionModule o;
			o=new UnityEngine.ParticleSystem.CollisionModule();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
// methods

    static bool CollisionModule_GetPlane__Int32(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
            UnityEngine.ParticleSystem.CollisionModule argThis = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;                JSMgr.datax.setObject((int)JSApi.SetType.Rval, argThis.GetPlane(arg0));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
    static bool CollisionModule_SetPlane__Int32__Transform(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            System.Int32          arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
            UnityEngine.Transform arg1 = (UnityEngine.Transform)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            UnityEngine.ParticleSystem.CollisionModule argThis = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;        argThis.SetPlane(arg0, arg1);
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
    static int QPYX_get_collision_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        UnityEngine.ParticleSystem QPYX_obj_YXQP = (UnityEngine.ParticleSystem)QPYX_o_YXQP;
            UnityEngine.ParticleSystem.CollisionModule QPYX_ret_YXQP = QPYX_obj_YXQP.collision;
            ToLua.PushValue(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 collision on a nil value"));
        }
    }
 static void CollisionModule_bounce(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         var result = _this.bounce;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.ParticleSystem.MinMaxCurve     arg0  = (UnityEngine.ParticleSystem.MinMaxCurve)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         _this.bounce = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
 static void CollisionModule_mode(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         var result = _this.mode;
         JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
     }
     else
     {
         UnityEngine.ParticleSystemCollisionMode    arg0  = (UnityEngine.ParticleSystemCollisionMode)JSApi.getEnum((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         _this.mode = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
 static void CollisionModule_sendCollisionMessages(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         var result = _this.sendCollisionMessages;
         JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
     }
     else
     {
         System.Boolean arg0 = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         _this.sendCollisionMessages = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
 static void CollisionModule_radiusScale(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         var result = _this.radiusScale;
         JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
     }
     else
     {
         System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         _this.radiusScale = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
 static void CollisionModule_maxCollisionShapes(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         var result = _this.maxCollisionShapes;
         JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
     }
     else
     {
         System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         _this.maxCollisionShapes = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
 static void CollisionModule_collidesWith(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         var result = _this.collidesWith;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.LayerMask arg0 = (UnityEngine.LayerMask)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.CollisionModule _this = (UnityEngine.ParticleSystem.CollisionModule)vc.csObj;
         _this.collidesWith = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
    static int get_collision(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)o;
            UnityEngine.ParticleSystem.CollisionModule ret = obj.collision;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index collision on a nil value"));
        }
    }
Пример #14
0
    void Gravity()
    {
        Paint script = GameObject.Find("PaintManager").GetComponent <Paint>();

        if (paint.inVr)
        {
            script.fluid1.GetComponent <ParticleSystem>().gravityModifier = 0.1f;
            script.fluid2.GetComponent <ParticleSystem>().gravityModifier = 0.1f;
        }
        else
        {
            script.fluid1.GetComponent <ParticleSystem>().gravityModifier = -0.1f;
            script.fluid2.GetComponent <ParticleSystem>().gravityModifier = -0.1f;
        }
        UnityEngine.ParticleSystem.CollisionModule mod = script.fluid1.GetComponent <ParticleSystem>().collision;
        mod.enabled = true;
        UnityEngine.ParticleSystem.CollisionModule mod2 = script.fluid2.GetComponent <ParticleSystem>().collision;
        mod2.enabled = true;
    }
    static int get_collision(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.ParticleSystem.collision");
#endif
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)o;
            UnityEngine.ParticleSystem.CollisionModule ret = obj.collision;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index collision on a nil value"));
        }
    }
Пример #16
0
    void Update()
    {
        // Update each pinch detector (one per hand)
        int index = 0;

        foreach (PinchDetector pd in pinchDetectors)
        {
            // Sets the fluid to the currently looped on fluid (mainly to save time refactoring code for the multi-hand support added)
            if (index == 0)
            {
                fluid = fluid1;
            }
            else
            {
                fluid = fluid2;
            }

            // Updates the fluids color based on user selection
            updateFluidColor();

            // Logic for painting
            float strength = pd.hand.GetLeapHand() != null?pd.hand.GetLeapHand().PinchStrength : 0f;

            float speed = pd.hand.GetLeapHand() != null?pd.hand.GetLeapHand().PalmVelocity.Magnitude : 0f;

            if (pd.DidStartHold)
            {
                if (fluidEnabled)
                {
                    // Spawns fluid at point
                    UnityEngine.ParticleSystem.EmissionModule em = fluid.GetComponent <ParticleSystem> ().emission;
                    em.enabled = true;

                    // Disable fluid collision
                    UnityEngine.ParticleSystem.CollisionModule mod = fluid.GetComponent <ParticleSystem> ().collision;
                    mod.enabled = false;

                    // Disable fluid gravity
                    fluid.GetComponent <ParticleSystem> ().gravityModifier = 0.0f;

                    Vector3 pos = pd.transform.position;
                    if (!inVr)
                    {
                        pos.y = -pos.y;
                    }
                    fluid.transform.position = pos;
                }
                else
                {
                    // Line stuff
                    paintLines [index].InitPaintLine();
                }
            }
            if (pd.DidRelease)
            {
                // Fluid stuff
                if (fluidEnabled)
                {
                    UnityEngine.ParticleSystem.EmissionModule em = fluid.GetComponent <ParticleSystem> ().emission;
                    em.enabled = false;
                }
                else
                {
                    // Line stuff
                    paintLines [index].EndPaintLine();
                }
            }
            if (pd.IsHolding)
            {
                if (fluidEnabled)
                {
                    // Fluid stuff
                    if (stencil == null || stencil.name == "Robot Kyle" || !snapping)
                    {
                        Vector3 pos = pd.Position;
                        if (!inVr)
                        {
                            pos.y = -pos.y;
                        }
                        fluid.transform.position = pos;
                    }
                    else
                    {
                        Vector3 pos = pd.Position;
                        if (!inVr)
                        {
                            pos.y = -pos.y;
                        }
                        Vector3 nearest = NearestVertexTo(pos, stencil);
                        fluid.transform.position = nearest;
                    }
                }
                else
                {
                    // Line stuff
                    if (stencil == null || stencil.name == "Robot Kyle" || !snapping)
                    {
                        paintLines[index].UpdatePaintLine(pd.Position, strength, speed);
                    }
                    else
                    {
                        paintLines[index].UpdatePaintLine(NearestVertexTo(pd.Position, stencil), strength, speed);
                    }
                }
            }
            index++;
        }
    }