//宴2.5対応 static void VersionUpSceneToUtage25(AdvEngine engine) { if (engine.MessageWindowManager == null) { } AdvUguiManager uguiManager = UtageEditorToolKit.FindComponentAllInTheScene <AdvUguiManager>(); if (uguiManager == null) { return; } uguiManager.GetMessageWindowManagerCreateIfMissing(); }
// 文字数オーバー チェック internal bool TryCheckCharacterCount(List <AdvScenarioData> scenarioList, out int count) { count = 0; AdvEngine engine = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngine>(); if (engine == null) { return(false); } AdvUguiManager uguiManager = UtageEditorToolKit.FindComponentAllInTheScene <AdvUguiManager>(); if (uguiManager == null) { return(false); } bool isActive = uguiManager.gameObject.activeSelf; if (!isActive) { uguiManager.gameObject.SetActive(true); // UguiLetterBoxCanvasScaler scaler = uguiManager.GetComponent<UguiLetterBoxCanvasScaler>(); // if (scaler != null) scaler.SetLayoutHorizontal(); } AdvUguiMessageWindow[] messageWindows = uguiManager.GetComponentsInChildren <AdvUguiMessageWindow>(true); Dictionary <string, AdvUguiMessageWindow> windows = new Dictionary <string, AdvUguiMessageWindow>(); foreach (var window in messageWindows) { windows.Add(window.name, window); } foreach (AdvScenarioData data in scenarioList) { count += data.EditorCheckCharacterCount(engine, windows); } if (!isActive) { uguiManager.gameObject.SetActive(false); } return(true); }
//宴2.5対応 static bool CheckVersionUpSceneToUtage25(AdvEngine engine) { AdvMessageWindowManager manager = UtageEditorToolKit.FindComponentAllInTheScene <AdvMessageWindowManager>(); if (manager == null) { return(true); } AdvUguiManager uguiManager = UtageEditorToolKit.FindComponentAllInTheScene <AdvUguiManager>(); if (uguiManager == null) { return(false); } AdvUguiMessageWindowManager mangaer = UtageEditorToolKit.FindComponentAllInTheScene <AdvUguiMessageWindowManager>(); return(mangaer == null); }
//旧バージョンとの互換性のための処理、メッセージウィンドウがなかったら作る static void CreateMessageWindowManager(AdvUguiManager uguiManager) { //旧バージョンとの互換性のため、なかったら作る AdvUguiMessageWindowManager manager = uguiManager.transform.AddChildGameObjectComponent <AdvUguiMessageWindowManager>("MessageWindowManager"); RectTransform rect = manager.gameObject.AddComponent <RectTransform>(); rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.one; rect.sizeDelta = Vector2.zero; rect.SetAsFirstSibling(); AdvUguiMessageWindow[] windows = uguiManager.GetComponentsInChildren <AdvUguiMessageWindow>(true); foreach (var window in windows) { window.transform.SetParent(rect, true); if (window.transform.localScale == Vector3.zero) { window.transform.localScale = Vector3.one; } } }