36 lines
1.0 KiB
C#
Raw Normal View History

2019-07-29 16:29:21 +02:00
///-----------------------------------------------------------------
/// 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;
2019-07-29 16:29:21 +02:00
namespace CozmoHelpers
{
2019-07-29 16:29:21 +02:00
public class SceneHelper : MonoBehaviour
{
[Tooltip("All the objects in this list will be deactivated/activated when the game is running")]
public List<GameObject> toggleInPlayMode;
2019-07-29 16:29:21 +02:00
public void Awake()
{
ToggleObjectList();
}
2019-07-29 16:29:21 +02:00
// Deactivate/Activate all gameObjects referenced in the toggleInPlayMode list
private void ToggleObjectList()
{
2019-07-29 16:29:21 +02:00
foreach (GameObject go in toggleInPlayMode)
{
go.SetActive(!go.activeSelf);
}
}
}
}