This commit is contained in:
2026-04-20 15:35:15 +05:30
parent dd509800c2
commit 8860a15bdd
7 changed files with 1286 additions and 712 deletions
+30
View File
@@ -0,0 +1,30 @@
using UnityEngine;
public class SetActiveOnEditor : MonoBehaviour
{
public Component[] components;
public GameObject[] gameObjects;
public bool activeOnEditor = true;
void Start()
{
#if UNITY_EDITOR
foreach(var component in components)
{
component.gameObject.SetActive(activeOnEditor);
}
foreach(var gameObject in gameObjects)
{
gameObject.SetActive(activeOnEditor);
}
#else
foreach(var component in components)
{
component.gameObject.SetActive(!activeOnEditor);
}
foreach(var gameObject in gameObjects)
{
gameObject.SetActive(!activeOnEditor);
}
#endif
}
}