static private string[] TokeniseHumanTransformsPath(string[] refTransformsPath, string[] humanTransforms) { if (humanTransforms == null) { return(null); } // all list must always include the string "" which is the root game object string[] tokeniseTransformsPath = new string[] { "" }; for (int i = 0; i < humanTransforms.Length; i++) { int index1 = ArrayUtility.FindIndex(refTransformsPath, s => humanTransforms[i] == FileUtil.GetLastPathNameComponent(s)); if (index1 != -1) { int insertIndex = tokeniseTransformsPath.Length; string path = refTransformsPath[index1]; while (path.Length > 0) { int index2 = ArrayUtility.FindIndex(tokeniseTransformsPath, s => path == s); if (index2 == -1) { ArrayUtility.Insert(ref tokeniseTransformsPath, insertIndex, path); } int lastIndex = path.LastIndexOf('/'); path = path.Substring(0, lastIndex != -1 ? lastIndex : 0); } } } return(tokeniseTransformsPath); }
private static string[] TokeniseHumanTransformsPath(string[] refTransformsPath, string[] humanTransforms) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type AvatarMaskUtility.\u003CTokeniseHumanTransformsPath\u003Ec__AnonStorey8C pathCAnonStorey8C = new AvatarMaskUtility.\u003CTokeniseHumanTransformsPath\u003Ec__AnonStorey8C(); // ISSUE: reference to a compiler-generated field pathCAnonStorey8C.humanTransforms = humanTransforms; // ISSUE: reference to a compiler-generated field if (pathCAnonStorey8C.humanTransforms == null) { return((string[])null); } string[] array = new string[1] { string.Empty }; // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type AvatarMaskUtility.\u003CTokeniseHumanTransformsPath\u003Ec__AnonStorey8D pathCAnonStorey8D = new AvatarMaskUtility.\u003CTokeniseHumanTransformsPath\u003Ec__AnonStorey8D(); // ISSUE: reference to a compiler-generated field pathCAnonStorey8D.\u003C\u003Ef__ref\u0024140 = pathCAnonStorey8C; // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field for (pathCAnonStorey8D.i = 0; pathCAnonStorey8D.i < pathCAnonStorey8C.humanTransforms.Length; pathCAnonStorey8D.i = pathCAnonStorey8D.i + 1) { // ISSUE: reference to a compiler-generated method int index = ArrayUtility.FindIndex <string>(refTransformsPath, new Predicate <string>(pathCAnonStorey8D.\u003C\u003Em__14C)); if (index != -1) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type AvatarMaskUtility.\u003CTokeniseHumanTransformsPath\u003Ec__AnonStorey8E pathCAnonStorey8E = new AvatarMaskUtility.\u003CTokeniseHumanTransformsPath\u003Ec__AnonStorey8E(); int length = array.Length; int num; // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field for (pathCAnonStorey8E.path = refTransformsPath[index]; pathCAnonStorey8E.path.Length > 0; pathCAnonStorey8E.path = pathCAnonStorey8E.path.Substring(0, num == -1 ? 0 : num)) { // ISSUE: reference to a compiler-generated method if (ArrayUtility.FindIndex <string>(array, new Predicate <string>(pathCAnonStorey8E.\u003C\u003Em__14D)) == -1) { // ISSUE: reference to a compiler-generated field ArrayUtility.Insert <string>(ref array, length, pathCAnonStorey8E.path); } // ISSUE: reference to a compiler-generated field num = pathCAnonStorey8E.path.LastIndexOf('/'); } } } return(array); }
internal static SettingsProvider CreateLanguagesProvider() { var editorLanguages = LocalizationDatabase.GetAvailableEditorLanguages(); if (m_EditorLanguageNames == null || m_EditorLanguageNames.Length != editorLanguages.Length) { m_EditorLanguageNames = new GUIContent[editorLanguages.Length]; for (int i = 0; i < editorLanguages.Length; ++i) { var culture = LocalizationDatabase.GetCulture(editorLanguages[i]); var langName = new System.Globalization.CultureInfo(culture).NativeName; // Due to the issue 1088990, workaround for both Chinese is necessary. // This workaround should be removed just after the fix. if (editorLanguages[i] == SystemLanguage.ChineseSimplified) { byte[] letters = { 0xE7, 0xAE, 0x80, 0xE4, 0xBD, 0x93, 0xE4, 0xB8, 0xAD, 0xE6, 0x96, 0x87 }; langName = System.Text.Encoding.UTF8.GetString(letters); } else if (editorLanguages[i] == SystemLanguage.ChineseTraditional) { byte[] letters = { 0xE7, 0xB9, 0x81, 0xE9, 0xAB, 0x94, 0xE4, 0xB8, 0xAD, 0xE6, 0x96, 0x87 }; langName = System.Text.Encoding.UTF8.GetString(letters); } // not in stable languages list - display it as experimental language if (ArrayUtility.FindIndex(m_stableLanguages, v => v == editorLanguages[i]) < 0) { m_EditorLanguageNames[i] = EditorGUIUtility.TextContent(string.Format("{0} (Experimental)", langName)); } else { m_EditorLanguageNames[i] = EditorGUIUtility.TextContent(langName); } } ArrayUtility.Insert(ref m_EditorLanguageNames, 0, EditorGUIUtility.TextContent("")); GUIContent defaultLanguage = EditorGUIUtility.TextContent(string.Format("Default ( {0} )", LocalizationDatabase.GetDefaultEditorLanguage().ToString())); ArrayUtility.Insert(ref m_EditorLanguageNames, 0, defaultLanguage); } if (editorLanguages.Length > 1) { var settings = new PreferencesProvider("Preferences/Languages"); settings.guiHandler = searchContext => { OnGUI(searchContext, settings.ShowLanguage); }; return(settings); } return(null); }
private void DoConnect() { AssetServer.RemoveMaintErrorsFromConsole(); int result = 0x29ed; string serverAddress = this.serverAddress; if (serverAddress.IndexOf(":") > 0) { int.TryParse(serverAddress.Substring(serverAddress.IndexOf(":") + 1), out result); serverAddress = serverAddress.Substring(0, serverAddress.IndexOf(":")); } this.port = result.ToString(); string str2 = AssetServer.GetDatabaseName(serverAddress, this.userName, this.password, this.port, this.projectName); this.GetDefaultPListConfig(); this.plc["Maint Server"] = serverAddress; this.plc["Maint UserName"] = this.userName; this.plc["Maint database name"] = str2; this.plc["Maint port number"] = this.port; this.plc["Maint project name"] = this.projectName; this.plc.Save(); if (ArrayUtility.Contains <string>(this.serversList, this.serverAddress)) { ArrayUtility.Remove <string>(ref this.serversList, this.serverAddress); } ArrayUtility.Insert <string>(ref this.serversList, 0, this.serverAddress); ASEditorBackend.AddUser(this.serverAddress, this.userName); ASEditorBackend.SetPassword(this.serverAddress, this.userName, this.password); InternalEditorUtility.SaveEditorSettingsList("ASServer", this.serversList, 20); if (str2 != string.Empty) { ASEditorBackend.InitializeMaintBinding(); this.parentWin.Reinit(); GUIUtility.ExitGUI(); } else { this.parentWin.NeedsSetup = true; this.parentWin.Repaint(); } }
internal static int InsertAnimationEvent(ref AnimationEvent[] events, AnimationClip clip, AnimationEvent evt) { Undo.RegisterCompleteObjectUndo(clip, "Add Event"); int num = events.Length; for (int i = 0; i < events.Length; i++) { if (events[i].time > evt.time) { num = i; break; } } ArrayUtility.Insert <AnimationEvent>(ref events, num, evt); AnimationUtility.SetAnimationEvents(clip, events); events = AnimationUtility.GetAnimationEvents(clip); if (events[num].time != evt.time || events[num].functionName != events[num].functionName) { Debug.LogError("Failed insertion"); } return(num); }
internal static int InsertAnimationEvent(ref AnimationEvent[] events, AnimationClip clip, AnimationEvent evt) { Undo.RegisterCompleteObjectUndo((UnityEngine.Object)clip, "Add Event"); int index1 = events.Length; for (int index2 = 0; index2 < events.Length; ++index2) { if ((double)events[index2].time > (double)evt.time) { index1 = index2; break; } } ArrayUtility.Insert <AnimationEvent>(ref events, index1, evt); AnimationUtility.SetAnimationEvents(clip, events); events = AnimationUtility.GetAnimationEvents(clip); if ((double)events[index1].time != (double)evt.time || events[index1].functionName != events[index1].functionName) { Debug.LogError((object)"Failed insertion"); } return(index1); }
private static int InsertAnimationEvent(ref AnimationEvent[] events, AnimationClip clip, AnimationEvent evt) { Undo.RegisterCompleteObjectUndo(clip, "Add Event"); int length = events.Length; for (int i = 0; i < events.Length; i++) { if (events[i].time > evt.time) { length = i; break; } } ArrayUtility.Insert <AnimationEvent>(ref events, length, evt); AnimationUtility.SetAnimationEvents(clip, events); events = AnimationUtility.GetAnimationEvents(clip); if ((events[length].time != evt.time) || (events[length].functionName != events[length].functionName)) { Debug.LogError("Failed insertion"); } return(length); }