Inheritance: Component
Exemplo n.º 1
0
 static public int set_useVirtualParticles(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.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         float             v;
         checkType(l, 2, out v);
         self.useVirtualParticles = v;
         pushValue(l, true);
         return(1);
     }
     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 void Cloth_sphereColliders(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Cloth _this = (UnityEngine.Cloth)vc.csObj;
         var result = _this.sphereColliders;
         var arrRet = result;
         for (int i = 0; arrRet != null && i < arrRet.Length; i++)
         {
             JSMgr.datax.setObject((int)JSApi.SetType.SaveAndTempTrace, arrRet[i]);
             JSApi.moveSaveID2Arr(i);
         }
         JSApi.setArrayS((int)JSApi.SetType.Rval, (arrRet != null ? arrRet.Length : 0), true);
     }
     else
     {
         UnityEngine.ClothSphereColliderPair[] arg0 = JSDataExchangeMgr.GetJSArg <UnityEngine.ClothSphereColliderPair[]>(() =>
         {
             int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg);
             int length  = JSApi.getArrayLength(jsObjID);
             var ret     = new UnityEngine.ClothSphereColliderPair[length];
             for (var i = 0; i < length; i++)
             {
                 JSApi.getElement(jsObjID, i);
                 ret[i] = (UnityEngine.ClothSphereColliderPair)JSMgr.datax.getObject((int)JSApi.GetType.SaveAndRemove);
             }
             return(ret);
         });
         UnityEngine.Cloth _this = (UnityEngine.Cloth)vc.csObj;
         _this.sphereColliders = arg0;
     }
 }
 static public int SetEnabledFading(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
             System.Boolean    a1;
             checkType(l, 2, out a1);
             self.SetEnabledFading(a1);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 3)
         {
             UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
             System.Boolean    a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             self.SetEnabledFading(a1, a2);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 4
0
 static public int get_coefficients(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.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.coefficients);
         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.Cloth cloth = (UnityEngine.Cloth)value;
     writer.WriteProperty("sleepThreshold", cloth.sleepThreshold);
     writer.WriteProperty("bendingStiffness", cloth.bendingStiffness);
     writer.WriteProperty("stretchingStiffness", cloth.stretchingStiffness);
     writer.WriteProperty("damping", cloth.damping);
     writer.WriteProperty("externalAcceleration", cloth.externalAcceleration);
     writer.WriteProperty("randomAcceleration", cloth.randomAcceleration);
     writer.WriteProperty("useGravity", cloth.useGravity);
     writer.WriteProperty("enabled", cloth.enabled);
     writer.WriteProperty("friction", cloth.friction);
     writer.WriteProperty("collisionMassScale", cloth.collisionMassScale);
                 #if UNITY_2017_2_OR_NEWER
     writer.WriteProperty("enableContinuousCollision", cloth.enableContinuousCollision);
                 #else
     writer.WriteProperty("useContinuousCollision", cloth.useContinuousCollision);
                 #endif
     writer.WriteProperty("useVirtualParticles", cloth.useVirtualParticles);
     writer.WriteProperty("coefficients", cloth.coefficients);
     writer.WriteProperty("worldVelocityScale", cloth.worldVelocityScale);
     writer.WriteProperty("worldAccelerationScale", cloth.worldAccelerationScale);
                 #if UNITY_2017_2_OR_NEWER
     writer.WriteProperty("clothSolverFrequency", cloth.clothSolverFrequency);
                 #else
     writer.WriteProperty("solverFrequency", cloth.solverFrequency);
                 #endif
     writer.WriteProperty("capsuleColliders", cloth.capsuleColliders);
     writer.WriteProperty("sphereColliders", cloth.sphereColliders);
     writer.WriteProperty("tag", cloth.tag);
     writer.WriteProperty("name", cloth.name);
     writer.WriteProperty("hideFlags", cloth.hideFlags);
 }
Exemplo n.º 6
0
 static public int constructor(IntPtr l)
 {
     UnityEngine.Cloth o;
     o = new UnityEngine.Cloth();
     pushObject(l, o);
     return(1);
 }
Exemplo n.º 7
0
 static public int set_randomAcceleration(IntPtr l)
 {
     UnityEngine.Cloth   o = (UnityEngine.Cloth)checkSelf(l);
     UnityEngine.Vector3 v;
     checkType(l, 2, out v);
     o.randomAcceleration = v;
     return(0);
 }
Exemplo n.º 8
0
    static public int set_damping(IntPtr l)
    {
        UnityEngine.Cloth o = (UnityEngine.Cloth)checkSelf(l);
        float             v;

        checkType(l, 2, out v);
        o.damping = v;
        return(0);
    }
Exemplo n.º 9
0
    static public int set_enabled(IntPtr l)
    {
        UnityEngine.Cloth o = (UnityEngine.Cloth)checkSelf(l);
        bool v;

        checkType(l, 2, out v);
        o.enabled = v;
        return(0);
    }
Exemplo n.º 10
0
    static public int set_stretchingStiffness(IntPtr l)
    {
        UnityEngine.Cloth o = (UnityEngine.Cloth)checkSelf(l);
        float             v;

        checkType(l, 2, out v);
        o.stretchingStiffness = v;
        return(0);
    }
Exemplo n.º 11
0
    static public int set_useGravity(IntPtr l)
    {
        UnityEngine.Cloth o = (UnityEngine.Cloth)checkSelf(l);
        bool v;

        checkType(l, 2, out v);
        o.useGravity = v;
        return(0);
    }
Exemplo n.º 12
0
    static public int set_selfCollision(IntPtr l)
    {
        UnityEngine.Cloth o = (UnityEngine.Cloth)checkSelf(l);
        bool v;

        checkType(l, 2, out v);
        o.selfCollision = v;
        return(0);
    }
Exemplo n.º 13
0
    static public int set_thickness(IntPtr l)
    {
        UnityEngine.Cloth o = (UnityEngine.Cloth)checkSelf(l);
        float             v;

        checkType(l, 2, out v);
        o.thickness = v;
        return(0);
    }
Exemplo n.º 14
0
 static public int get_capsuleColliders(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, self.capsuleColliders);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Exemplo n.º 15
0
 static public int get_sleepThreshold(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, self.sleepThreshold);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Exemplo n.º 16
0
 static public int get_worldAccelerationScale(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, self.worldAccelerationScale);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Cloth o;
			o=new UnityEngine.Cloth();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Exemplo n.º 18
0
 static public int get_bendingStiffness(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, self.bendingStiffness);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int get_stretchingStiffness(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.stretchingStiffness);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_damping(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.damping);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_sleepThreshold(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.sleepThreshold);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_randomAcceleration(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.randomAcceleration);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_solverFrequency(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.solverFrequency);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_sphereColliders(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.sphereColliders);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_useVirtualParticles(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.useVirtualParticles);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 26
0
 static public int get_useContinuousCollision(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, self.useContinuousCollision);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int get_useContinuousCollision(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.useContinuousCollision);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int ClearTransformMotion(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         self.ClearTransformMotion();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 29
0
 static public int get_constrainSurfacePenetration(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.constrainSurfacePenetration);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 30
0
 static public int get_useVirtualParticles(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, self.useVirtualParticles);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int get_worldVelocityScale(IntPtr l)
 {
     try {
         UnityEngine.Cloth self = (UnityEngine.Cloth)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.worldVelocityScale);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 32
0
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Cloth o;
         o=new UnityEngine.Cloth();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
Exemplo n.º 33
0
 private static extern void INTERNAL_CALL_ClearTransformMotion(Cloth self);
Exemplo n.º 34
0
 public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj)
     : base(owner, obj)
 {
     this.m_cloth = this.m_obj.GetComponent<Cloth>();
 }
Exemplo n.º 35
0
        // Returns true if the collider is used by the Cloth.
        private static bool IsClothCollider(Collider collider, Cloth[] cloths)
        {
            if (cloths == null) return false;

            foreach (Cloth cloth in cloths) {
                if (cloth == null) return false;
                foreach (CapsuleCollider c in cloth.capsuleColliders) {
                    if (c.gameObject == collider.gameObject) return true;
                }
                foreach (ClothSphereColliderPair s in cloth.sphereColliders) {
                    if (s.first.gameObject == collider.gameObject) return true;
                    if (s.second.gameObject == collider.gameObject) return true;
                }
            }

            return false;
        }