add ckg
plantilla base para movimiento básico
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class simpleGUILayoutStateManager : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setStateOnStart;
|
||||
public bool stateOnStart;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool showDebugPrint;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (setStateOnStart) {
|
||||
setGUILayoutState (stateOnStart);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setGUILayoutState (bool state)
|
||||
{
|
||||
MonoBehaviour [] MonoBehaviourList = FindObjectsOfType<MonoBehaviour> ();
|
||||
|
||||
foreach (MonoBehaviour currentMonoBehaviour in MonoBehaviourList) {
|
||||
if (currentMonoBehaviour.useGUILayout != state) {
|
||||
currentMonoBehaviour.useGUILayout = state;
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print (currentMonoBehaviour.name + " " + currentMonoBehaviour.useGUILayout);
|
||||
}
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print (MonoBehaviourList.Length + " monobehaviors found");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user