Ver código fonte

refactor Destroy function to use GraphicsUtils

meidomustard 5 anos atrás
pai
commit
dde3e0a65f

+ 57 - 56
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Init.cs

@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using UnityEngine;
+using UnityEngine.PostProcessing;
 
 namespace CM3D2.MultipleMaids.Plugin
 {
@@ -314,37 +315,37 @@ namespace CM3D2.MultipleMaids.Plugin
                 xFlg[index1] = false;
                 zFlg[index1] = false;
                 ikMode[index1] = 0;
-                Destroy(gMaid[index1]);
-                Destroy(gMaidC[index1]);
-                Destroy(gHandL[index1]);
-                Destroy(gArmL[index1]);
-                Destroy(gHandR[index1]);
-                Destroy(gArmR[index1]);
-                Destroy(gFootL[index1]);
-                Destroy(gHizaL[index1]);
-                Destroy(gFootR[index1]);
-                Destroy(gHizaR[index1]);
-                Destroy(gClavicleL[index1]);
-                Destroy(gClavicleR[index1]);
-                Destroy(gNeck[index1]);
-                Destroy(gSpine[index1]);
-                Destroy(gSpine0a[index1]);
-                Destroy(gSpine1a[index1]);
-                Destroy(gSpine1[index1]);
-                Destroy(gPelvis[index1]);
-                Destroy(gizmoHandL[index1]);
-                Destroy(gizmoHandR[index1]);
-                Destroy(gizmoFootL[index1]);
-                Destroy(gizmoFootR[index1]);
+                GraphicsUtils.Destroy(gMaid[index1]);
+                GraphicsUtils.Destroy(gMaidC[index1]);
+                GraphicsUtils.Destroy(gHandL[index1]);
+                GraphicsUtils.Destroy(gArmL[index1]);
+                GraphicsUtils.Destroy(gHandR[index1]);
+                GraphicsUtils.Destroy(gArmR[index1]);
+                GraphicsUtils.Destroy(gFootL[index1]);
+                GraphicsUtils.Destroy(gHizaL[index1]);
+                GraphicsUtils.Destroy(gFootR[index1]);
+                GraphicsUtils.Destroy(gHizaR[index1]);
+                GraphicsUtils.Destroy(gClavicleL[index1]);
+                GraphicsUtils.Destroy(gClavicleR[index1]);
+                GraphicsUtils.Destroy(gNeck[index1]);
+                GraphicsUtils.Destroy(gSpine[index1]);
+                GraphicsUtils.Destroy(gSpine0a[index1]);
+                GraphicsUtils.Destroy(gSpine1a[index1]);
+                GraphicsUtils.Destroy(gSpine1[index1]);
+                GraphicsUtils.Destroy(gPelvis[index1]);
+                GraphicsUtils.Destroy(gizmoHandL[index1]);
+                GraphicsUtils.Destroy(gizmoHandR[index1]);
+                GraphicsUtils.Destroy(gizmoFootL[index1]);
+                GraphicsUtils.Destroy(gizmoFootR[index1]);
                 HandL1[index1] = null;
                 for (int index2 = 0; index2 < 30; ++index2)
                 {
-                    Destroy(gFinger[index1, index2]);
+                    GraphicsUtils.Destroy(gFinger[index1, index2]);
                 }
 
                 for (int index2 = 0; index2 < 12; ++index2)
                 {
-                    Destroy(gFinger2[index1, index2]);
+                    GraphicsUtils.Destroy(gFinger2[index1, index2]);
                 }
 
                 isIK[index1] = isIKAll;
@@ -414,7 +415,7 @@ namespace CM3D2.MultipleMaids.Plugin
             GameMain.Instance.MainLight.gameObject.transform.position = new Vector3(0.0f, 2f, 0.0f);
             for (int index = 0; index < doguBObject.Count; ++index)
             {
-                Destroy(doguBObject[index]);
+                GraphicsUtils.Destroy(doguBObject[index]);
             }
 
             doguBObject.Clear();
@@ -424,7 +425,7 @@ namespace CM3D2.MultipleMaids.Plugin
             parCombo.selectedItemIndex = 0;
             for (int index = 1; index < lightList.Count; ++index)
             {
-                Destroy(lightList[index]);
+                GraphicsUtils.Destroy(lightList[index]);
             }
 
             lightList = new List<GameObject>
@@ -457,7 +458,7 @@ namespace CM3D2.MultipleMaids.Plugin
             {
                 if (doguObject[index] != null)
                 {
-                    Destroy(doguObject[index]);
+                    GraphicsUtils.Destroy(doguObject[index]);
                     doguObject[index] = null;
                 }
             }
@@ -817,37 +818,37 @@ namespace CM3D2.MultipleMaids.Plugin
                 xFlg[index1] = false;
                 zFlg[index1] = false;
                 ikMode[index1] = 0;
-                Destroy(gMaid[index1]);
-                Destroy(gMaidC[index1]);
-                Destroy(gHandL[index1]);
-                Destroy(gArmL[index1]);
-                Destroy(gHandR[index1]);
-                Destroy(gArmR[index1]);
-                Destroy(gFootL[index1]);
-                Destroy(gHizaL[index1]);
-                Destroy(gFootR[index1]);
-                Destroy(gHizaR[index1]);
-                Destroy(gClavicleL[index1]);
-                Destroy(gClavicleR[index1]);
-                Destroy(gNeck[index1]);
-                Destroy(gSpine[index1]);
-                Destroy(gSpine0a[index1]);
-                Destroy(gSpine1a[index1]);
-                Destroy(gSpine1[index1]);
-                Destroy(gPelvis[index1]);
-                Destroy(gizmoHandL[index1]);
-                Destroy(gizmoHandR[index1]);
-                Destroy(gizmoFootL[index1]);
-                Destroy(gizmoFootR[index1]);
+                GraphicsUtils.Destroy(gMaid[index1]);
+                GraphicsUtils.Destroy(gMaidC[index1]);
+                GraphicsUtils.Destroy(gHandL[index1]);
+                GraphicsUtils.Destroy(gArmL[index1]);
+                GraphicsUtils.Destroy(gHandR[index1]);
+                GraphicsUtils.Destroy(gArmR[index1]);
+                GraphicsUtils.Destroy(gFootL[index1]);
+                GraphicsUtils.Destroy(gHizaL[index1]);
+                GraphicsUtils.Destroy(gFootR[index1]);
+                GraphicsUtils.Destroy(gHizaR[index1]);
+                GraphicsUtils.Destroy(gClavicleL[index1]);
+                GraphicsUtils.Destroy(gClavicleR[index1]);
+                GraphicsUtils.Destroy(gNeck[index1]);
+                GraphicsUtils.Destroy(gSpine[index1]);
+                GraphicsUtils.Destroy(gSpine0a[index1]);
+                GraphicsUtils.Destroy(gSpine1a[index1]);
+                GraphicsUtils.Destroy(gSpine1[index1]);
+                GraphicsUtils.Destroy(gPelvis[index1]);
+                GraphicsUtils.Destroy(gizmoHandL[index1]);
+                GraphicsUtils.Destroy(gizmoHandR[index1]);
+                GraphicsUtils.Destroy(gizmoFootL[index1]);
+                GraphicsUtils.Destroy(gizmoFootR[index1]);
                 HandL1[index1] = null;
                 for (int index2 = 0; index2 < 30; ++index2)
                 {
-                    Destroy(gFinger[index1, index2]);
+                    GraphicsUtils.Destroy(gFinger[index1, index2]);
                 }
 
                 for (int index2 = 0; index2 < 12; ++index2)
                 {
-                    Destroy(gFinger2[index1, index2]);
+                    GraphicsUtils.Destroy(gFinger2[index1, index2]);
                 }
 
                 isIK[index1] = isIKAll;
@@ -908,8 +909,8 @@ namespace CM3D2.MultipleMaids.Plugin
             isIdx2 = false;
             isIdx3 = false;
             isIdx4 = false;
-            Destroy(cameraObj);
-            Destroy(subcamera);
+            GraphicsUtils.Destroy(cameraObj);
+            GraphicsUtils.Destroy(subcamera);
             bgObject.SetActive(true);
             GameMain.Instance.MainLight.Reset();
             GameMain.Instance.MainLight.SetIntensity(0.95f);
@@ -932,7 +933,7 @@ namespace CM3D2.MultipleMaids.Plugin
 
             for (int index = 0; index < doguBObject.Count; ++index)
             {
-                Destroy(doguBObject[index]);
+                GraphicsUtils.Destroy(doguBObject[index]);
             }
 
             doguBObject.Clear();
@@ -942,7 +943,7 @@ namespace CM3D2.MultipleMaids.Plugin
             parCombo.selectedItemIndex = 0;
             for (int index = 1; index < lightList.Count; ++index)
             {
-                Destroy(lightList[index]);
+                GraphicsUtils.Destroy(lightList[index]);
             }
 
             lightList = new List<GameObject>
@@ -979,7 +980,7 @@ namespace CM3D2.MultipleMaids.Plugin
             {
                 if (doguObject[index] != null)
                 {
-                    Destroy(doguObject[index]);
+                    GraphicsUtils.Destroy(doguObject[index]);
                     doguObject[index] = null;
                 }
             }

+ 10 - 9
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Update.cs

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using UnityEngine;
+using UnityEngine.PostProcessing;
 using UnityEngine.Rendering;
 using Object = UnityEngine.Object;
 
@@ -3191,7 +3192,7 @@ namespace CM3D2.MultipleMaids.Plugin
 
                 if (doguObject.Count > 0 && doguObject[doguSelectIndex] != null)
                 {
-                    Destroy(doguObject[doguSelectIndex]);
+                    GraphicsUtils.Destroy(doguObject[doguSelectIndex]);
                     doguObject.RemoveAt(doguSelectIndex);
                     doguIndex.RemoveAt(doguSelectIndex);
                 }
@@ -3323,7 +3324,7 @@ namespace CM3D2.MultipleMaids.Plugin
 
                     for (int index = 1; index < lightList.Count; ++index)
                     {
-                        Destroy(lightList[index]);
+                        GraphicsUtils.Destroy(lightList[index]);
                     }
 
                     lightIndex = new List<int>
@@ -3497,7 +3498,7 @@ namespace CM3D2.MultipleMaids.Plugin
                     }
                     else if (doguObject.Count > 0 && doguObject[doguSelectIndex] != null)
                     {
-                        Destroy(doguObject[doguSelectIndex]);
+                        GraphicsUtils.Destroy(doguObject[doguSelectIndex]);
                         doguObject.RemoveAt(doguSelectIndex);
                     }
                     else
@@ -4709,7 +4710,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 {
                     for (int index = 0; index < doguBObject.Count; ++index)
                     {
-                        Destroy(doguBObject[index]);
+                        GraphicsUtils.Destroy(doguBObject[index]);
                     }
 
                     doguBObject = new List<GameObject>();
@@ -4867,7 +4868,7 @@ namespace CM3D2.MultipleMaids.Plugin
 
                                     doguBObject.Add(original1);
                                     original1.transform.parent = null;
-                                    Destroy(gameObject);
+                                    GraphicsUtils.Destroy(gameObject);
                                     gameObject.SetActive(false);
                                 }
 
@@ -6154,7 +6155,7 @@ namespace CM3D2.MultipleMaids.Plugin
                                 new Vector3(lightX6, lightY6, GameMain.Instance.MainLight.transform.eulerAngles.z);
                         for (int index = 0; index < doguBObject.Count; ++index)
                         {
-                            Destroy(doguBObject[index]);
+                            GraphicsUtils.Destroy(doguBObject[index]);
                         }
 
                         doguBObject.Clear();
@@ -6164,7 +6165,7 @@ namespace CM3D2.MultipleMaids.Plugin
                         parCombo.selectedItemIndex = 0;
                         for (int index = 1; index < lightList.Count; ++index)
                         {
-                            Destroy(lightList[index]);
+                            GraphicsUtils.Destroy(lightList[index]);
                         }
 
                         lightList = new List<GameObject>
@@ -6201,7 +6202,7 @@ namespace CM3D2.MultipleMaids.Plugin
                         {
                             if (doguObject[index] != null)
                             {
-                                Destroy(doguObject[index]);
+                                GraphicsUtils.Destroy(doguObject[index]);
                                 doguObject[index] = null;
                             }
                         }
@@ -7016,7 +7017,7 @@ namespace CM3D2.MultipleMaids.Plugin
                             if (mDogu[index].del)
                             {
                                 mDogu[index].del = false;
-                                Destroy(doguBObject[index]);
+                                GraphicsUtils.Destroy(doguBObject[index]);
                                 doguBObject.RemoveAt(index);
                             }
                             else if (mDogu[index].count > 0)

BIN
MultipleMaids/lib/Assembly-CSharp.dll


BIN
MultipleMaids/lib/Assembly-UnityScript-firstpass.dll