public override void OnEnable() { base.OnEnable(); cloth = (ObiTearableCloth)target; particlePropertyNames.AddRange(new string[] { "Tear Resistance" }); }
public override void OnEnable() { base.OnEnable(); cloth = (ObiTearableCloth)target; particlePropertyNames.AddRange(new string[] { "Tear Resistance" }); // show wireframe EditorUtility.SetSelectedWireframeHidden(cloth.GetComponent <Renderer>(), false); }
static void CreateObiClothWithSolver() { GameObject c = new GameObject("Obi Tearable Cloth"); Undo.RegisterCreatedObjectUndo(c, "Create Obi Tearable Cloth"); c.AddComponent <MeshFilter>(); c.AddComponent <MeshRenderer>(); ObiTearableCloth cloth = c.AddComponent <ObiTearableCloth>(); ObiSolver solver = c.AddComponent <ObiSolver>(); cloth.Solver = solver; }