private void Awake() { if (instance_ != null) { this.LogError("Already have an instance of Trigger executor!"); DestroyImmediate(this); return; } settings_ = CyanEmuSettings.Instance; instance_ = this; DontDestroyOnLoad(this); CyanEmuInputModule.DisableOtherInputModules(); gameObject.AddComponent <CyanEmuBaseInput>(); gameObject.AddComponent <CyanEmuInputModule>(); descriptor_ = FindObjectOfType <VRC_SceneDescriptor>(); if (descriptor_ == null) { Debug.LogWarning("There is no VRC_SceneDescriptor in the scene."); } // SDK manager class #if VRC_SDK_VRCSDK2 sdkManager_ = gameObject.AddComponent <CyanEmuTriggerExecutor>(); #endif #if UDON sdkManager_ = gameObject.AddComponent <CyanEmuUdonManager>(); #endif StartCoroutine(OnNetworkReady()); }
void OnGUI() { float tempLabelWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 175; boxStyle_ = new GUIStyle(EditorStyles.helpBox); scrollPosition_ = EditorGUILayout.BeginScrollView(scrollPosition_); DrawHeader(); EditorGUI.BeginChangeCheck(); // Disables UI if CyanEmu is disabled DrawGeneralSettings(); DrawPlayerControllerSettings(); DrawPlayerButtons(); DrawBufferedTriggerSettings(); // Disable group from General settings EditorGUI.EndDisabledGroup(); EditorGUILayout.EndScrollView(); if (EditorGUI.EndChangeCheck()) { CyanEmuSettings.SaveSettings(settings_); } EditorGUIUtility.labelWidth = tempLabelWidth; }
public static void TryInitOnLoad() { settings_ = CyanEmuSettings.Instance; if (settings_.displaySettingsWindowAtLaunch) { Init(); } }
private static CyanEmuSettings LoadSettings() { CyanEmuSettings settings = new CyanEmuSettings(); string data = EditorPrefs.GetString(CYAN_EMU_SETTINGS_PREFS_STRING, JsonUtility.ToJson(settings, false)); JsonUtility.FromJsonOverwrite(data, settings); return(settings); }
private void OnEnable() { if (settings_ == null) { settings_ = CyanEmuSettings.Instance; } version_ = System.IO.File.ReadAllText(VERSION_FILE_PATH).Trim(); if (settings_.displaySettingsWindowAtLaunch) { settings_.displaySettingsWindowAtLaunch = false; CyanEmuSettings.SaveSettings(settings_); } }
private static CyanEmuSettings LoadSettings() { CyanEmuSettings settings = new CyanEmuSettings(); string data = null; if (EditorPrefs.HasKey(CYAN_EMU_LEGACY_SETTINGS_PREFS_STRING)) { data = EditorPrefs.GetString(CYAN_EMU_LEGACY_SETTINGS_PREFS_STRING); EditorPrefs.DeleteKey(CYAN_EMU_LEGACY_SETTINGS_PREFS_STRING); } else { data = EditorPrefs.GetString(CYAN_EMU_SETTINGS_PREFS_STRING, JsonUtility.ToJson(settings, false)); } JsonUtility.FromJsonOverwrite(data, settings); return(settings); }
private void Awake() { if (instance_ != null) { this.LogError("Already have an instance of Trigger executor!"); DestroyImmediate(this); return; } instance_ = this; settings_ = CyanEmuSettings.Instance; bufferManager_ = new CyanEmuBufferManager(); if (settings_.replayBufferedTriggers) { CyanEmuBufferManager.LoadBufferedTriggersFromFile(); } }
private void Awake() { if (instance_ != null) { this.LogError("Already have an instance of Trigger executor!"); DestroyImmediate(this); return; } instance_ = this; settings_ = CyanEmuSettings.Instance; descriptor_ = FindObjectOfType <VRC_SceneDescriptor>(); bufferManager_ = new CyanEmuBufferManager(); if (settings_.replayBufferedTriggers) { CyanEmuBufferManager.LoadBufferedTriggersFromFile(); } SetupCombat(); }
public static void SaveSettings(CyanEmuSettings settings) { string data = JsonUtility.ToJson(settings, false); EditorPrefs.SetString(CYAN_EMU_SETTINGS_PREFS_STRING, data); }