You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SceneHelper.cs 504B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class SceneHelper : MonoBehaviour
  5. {
  6. [Tooltip("All the objects in this list will be deactivated/activated when the game is running")]
  7. public List<GameObject> toggleInPlayMode;
  8. public void Awake()
  9. {
  10. ToggleObjectList();
  11. }
  12. private void ToggleObjectList()
  13. {
  14. foreach (GameObject go in toggleInPlayMode)
  15. {
  16. go.SetActive(!go.activeSelf);
  17. }
  18. }
  19. }