コード例 #1
0
        void SetParentTool()
        {
            int oldPid = its.GetNode(setParentSelfId).parentId;

            using (var h = new EditorGUILayout.HorizontalScope("helpbox")) {
                GUILayout.Label("Child Part", GUILayout.ExpandWidth(false));
                setParentSelfId = EditorGUILayout.IntField(setParentSelfId, GUILayout.Width(20));
                GUILayout.Label(": Parent [" + oldPid + "]  ->", GUILayout.ExpandWidth(false));
                setParentNewId = EditorGUILayout.IntField(setParentNewId, GUILayout.Width(20));
                if (GUILayout.Button("Go"))
                {
                    RelinkParent(setParentSelfId, setParentNewId);
                }
            }
        }
コード例 #2
0
 public void CheckPartLife()
 {
     if (isCheckEmpty)
     {
         bool isempty = true;
         foreach (int i in item.GetNode(id).childIds)
         {
             if (item.GetNode(i).part_Instance)
             {
                 isempty = false;
             }
         }
         if (isempty)
         {
             Debug.Log("<" + GetInstanceID() + "><color=red>" + name + "</color> was destroyed because of no childs \n");
             DestroySelf();
         }
     }
 }