Beispiel #1
0
 private static void SetEnabled(VisibilityStruct visibilityStruct)
 {
     if (visibilityStruct.MatProps != null)
     {
         foreach (var matProp in visibilityStruct.MatProps)
         {
             matProp.SetEnabled(visibilityStruct.Enabled);
         }
     }
     if (visibilityStruct.GameObjects != null)
     {
         foreach (var go in visibilityStruct.GameObjects)
         {
             var objectSwitches = go.GetComponentsInChildren <ObjectSwitchBase>();
             if (objectSwitches != null && objectSwitches.Length > 0)
             {
                 foreach (var switchBase in objectSwitches)
                 {
                     switchBase.Active = visibilityStruct.Enabled;
                 }
             }
             else
             {
                 go.SetActive(visibilityStruct.Enabled);
             }
         }
     }
 }
Beispiel #2
0
 private static void SetEnabled(VisibilityStruct visibilityStruct)
 {
     if (visibilityStruct.MatProps != null)
         foreach (var matProp in visibilityStruct.MatProps)
             matProp.SetEnabled(visibilityStruct.Enabled);
     if (visibilityStruct.GameObjects != null)
         foreach (var go in visibilityStruct.GameObjects)
         {
             var objectSwitches = go.GetComponentsInChildren<ObjectSwitchBase>();
             if (objectSwitches != null && objectSwitches.Length > 0)
             {
                 foreach (var switchBase in objectSwitches)
                     switchBase.Active = visibilityStruct.Enabled;
             }
             else
                 go.SetActive(visibilityStruct.Enabled);
         }
 }