1234567891011121314151617181920212223242526272829303132333435 |
- ///-----------------------------------------------------------------
- /// Namespace: <CozmoHelpers>
- /// Class: <SceneHelper>
- /// Description: <Used to deactivate specific objects that are only used in the sceneview not in the gameview>
- /// Author: <Tobias Hassel> Date: <29.07.2019>
- /// Notes: <>
- ///-----------------------------------------------------------------
- ///
-
- using System.Collections.Generic;
- using UnityEngine;
-
- namespace CozmoHelpers
- {
- public class SceneHelper : MonoBehaviour
- {
- [Tooltip("All the objects in this list will be deactivated/activated when the game is running")]
- public List<GameObject> toggleInPlayMode;
-
-
- public void Awake()
- {
- ToggleObjectList();
- }
-
- // Deactivate/Activate all gameObjects referenced in the toggleInPlayMode list
- private void ToggleObjectList()
- {
- foreach (GameObject go in toggleInPlayMode)
- {
- go.SetActive(!go.activeSelf);
- }
- }
- }
- }
|