Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            //Draw the defualt inspector options
            DrawDefaultInspector();

            GameObjectVariable script = (GameObjectVariable)target;

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            EditorGUILayout.LabelField("Debugging Options", EditorStyles.centeredGreyMiniLabel);

            if (script.Value != null)
            {
                EditorGUILayout.LabelField("Current value: " + script.Value.name, EditorStyles.boldLabel);
            }
            else
            {
                EditorGUILayout.LabelField("Current value: ", EditorStyles.boldLabel);
            }
            //Display button that resets the value to the starting value
            if (GUILayout.Button("Reset Value"))
            {
                if (EditorApplication.isPlaying)
                {
                    script.ResetValue();
                }
            }
            EditorGUILayout.EndVertical();
        }
Esempio n. 2
0
 /// <summary>
 /// Set Value to another sGameObject Value
 /// </summary>
 /// <param name="_value"></param>
 public void SetValue(GameObjectVariable _value)
 {
     Value = _value.Value;
 }