Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            TentuPlaySettings settings = (TentuPlaySettings)target;

            TentuPlaySettings.SetInstance(settings);

            EditorGUILayout.LabelField("General Settings", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            TentuPlaySettings.ApiKey = EditorGUILayout.TextField(apiKeyLabel, TentuPlaySettings.ApiKey).Trim();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            TentuPlaySettings.Secret = EditorGUILayout.TextField(secretLabel, TentuPlaySettings.Secret).Trim();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            TentuPlaySettings.DEBUG = EditorGUILayout.Toggle(debugLabel, TentuPlaySettings.DEBUG);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            TentuPlaySettings.AutoUpload = EditorGUILayout.Toggle(autoUploadLabel, TentuPlaySettings.AutoUpload);
            EditorGUILayout.EndHorizontal();

            if (TentuPlaySettings.AutoUpload)
            {
                EditorGUILayout.BeginHorizontal();
                TentuPlaySettings.DeferredSendIntervalSec = EditorGUILayout.IntField(deferredSendIntervalSecLabel, TentuPlaySettings.DeferredSendIntervalSec);
                //trim
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Advanced Settings", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            TentuPlaySettings.AdvicesGetInterval = EditorGUILayout.IntField(advicesGetInterval, TentuPlaySettings.AdvicesGetInterval);
            EditorGUILayout.EndHorizontal();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(settings);
                AssetDatabase.SaveAssets();
            }
        }
Ejemplo n.º 2
0
 void OnDisable()
 {
     // make sure the runtime code will load the Asset from Resources when it next tries to access this.
     TentuPlaySettings.SetInstance(null);
 }