|
@@ -1,4 +1,5 @@
|
|
|
using System.Linq;
|
|
|
+using System;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.IO;
|
|
@@ -16,10 +17,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
private WindowManager windowManager;
|
|
|
private MeidoManager meidoManager;
|
|
|
private EnvironmentManager environmentManager;
|
|
|
- private MessageWindowManager messageWindowManager;
|
|
|
private PropManager propManager;
|
|
|
- private LightManager lightManager;
|
|
|
- private EffectManager effectManager;
|
|
|
+ // private LightManager lightManager;
|
|
|
+ // private EffectManager effectManager;
|
|
|
+ private MessageWindowManager messageWindowManager;
|
|
|
private Constants.Scene currentScene;
|
|
|
private bool initialized = false;
|
|
|
private bool isActive = false;
|
|
@@ -45,15 +46,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
{
|
|
|
if (Input.GetKeyDown(KeyCode.F6))
|
|
|
{
|
|
|
- if (!initialized)
|
|
|
- {
|
|
|
- Initialize();
|
|
|
- windowManager.MainWindowVisible = true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ReturnToMenu();
|
|
|
- }
|
|
|
+ if (isActive) Deactivate();
|
|
|
+ else Activate();
|
|
|
}
|
|
|
|
|
|
if (isActive)
|
|
@@ -65,8 +59,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
}
|
|
|
|
|
|
meidoManager.Update();
|
|
|
- windowManager.Update();
|
|
|
environmentManager.Update();
|
|
|
+ windowManager.Update();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -81,7 +75,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/SystemDialog", false);
|
|
|
GameObject sysShortcut =
|
|
|
UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/SystemShortcut", false);
|
|
|
- if (editUI != null) editUI.SetActive(false);
|
|
|
+ editUI.SetActive(false);
|
|
|
fpsViewer.SetActive(false);
|
|
|
sysDialog.SetActive(false);
|
|
|
sysShortcut.SetActive(false);
|
|
@@ -93,7 +87,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
{
|
|
|
Meido meido = activeMeidoList[i];
|
|
|
isIK[i] = meido.IsIK;
|
|
|
- if (meido.IsIK) meido.SetIKActive(false);
|
|
|
+ if (meido.IsIK) meido.IsIK = false;
|
|
|
}
|
|
|
|
|
|
GizmoRender.UIVisible = false;
|
|
@@ -111,7 +105,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
|
|
|
// Show UI and dragpoints
|
|
|
uiActive = true;
|
|
|
- if (editUI != null) editUI.SetActive(true);
|
|
|
+ editUI.SetActive(true);
|
|
|
fpsViewer.SetActive(GameMain.Instance.CMSystem.ViewFps);
|
|
|
sysDialog.SetActive(true);
|
|
|
sysShortcut.SetActive(true);
|
|
@@ -119,112 +113,93 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
for (int i = 0; i < activeMeidoList.Count; i++)
|
|
|
{
|
|
|
Meido meido = activeMeidoList[i];
|
|
|
- if (isIK[i]) meido.SetIKActive(true);
|
|
|
+ if (isIK[i]) meido.IsIK = true;
|
|
|
}
|
|
|
|
|
|
GizmoRender.UIVisible = true;
|
|
|
}
|
|
|
+
|
|
|
private void OnGUI()
|
|
|
{
|
|
|
if (uiActive)
|
|
|
{
|
|
|
- windowManager.OnGUI();
|
|
|
+ windowManager.DrawWindows();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)
|
|
|
{
|
|
|
currentScene = (Constants.Scene)scene.buildIndex;
|
|
|
- }
|
|
|
- private void ReturnToMenu()
|
|
|
- {
|
|
|
- if (meidoManager.IsBusy) return;
|
|
|
- meidoManager.Deactivate();
|
|
|
- environmentManager.Deactivate();
|
|
|
- messageWindowManager.Deactivate();
|
|
|
|
|
|
- isActive = false;
|
|
|
- uiActive = false;
|
|
|
- initialized = false;
|
|
|
- windowManager.MainWindowVisible = false;
|
|
|
- GameMain.Instance.SoundMgr.PlayBGM("bgm009.ogg", 1f, true);
|
|
|
- GameObject go = GameObject.Find("UI Root").transform.Find("DailyPanel").gameObject;
|
|
|
- go.SetActive(true);
|
|
|
- bool isNight = GameMain.Instance.CharacterMgr.status.GetFlag("時間帯") == 3;
|
|
|
-
|
|
|
- if (isNight)
|
|
|
- {
|
|
|
- GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu_ChairRot_Night");
|
|
|
- }
|
|
|
- else
|
|
|
+ if (currentScene == Constants.Scene.Daily)
|
|
|
{
|
|
|
- GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu_ChairRot");
|
|
|
+ if (!initialized) Initialize();
|
|
|
}
|
|
|
-
|
|
|
- GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
|
|
|
- GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0.5609447f, 1.380762f, -1.382336f), true);
|
|
|
- GameMain.Instance.MainCamera.SetDistance(1.6f, true);
|
|
|
- GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(245.5691f, 6.273283f), true);
|
|
|
}
|
|
|
|
|
|
private void Initialize()
|
|
|
{
|
|
|
- TabsPane.SelectedTab = Constants.Window.Call;
|
|
|
- initialized = true;
|
|
|
- meidoManager = new MeidoManager();
|
|
|
-
|
|
|
- meidoManager.BeginCallMeidos += (s, a) => this.uiActive = false;
|
|
|
- meidoManager.EndCallMeidos += (s, a) => this.uiActive = true;
|
|
|
+ if (initialized) return;
|
|
|
|
|
|
- lightManager = new LightManager();
|
|
|
+ meidoManager = new MeidoManager();
|
|
|
propManager = new PropManager();
|
|
|
- effectManager = new EffectManager();
|
|
|
- environmentManager = new EnvironmentManager(propManager, lightManager, effectManager);
|
|
|
+ // lightManager = new LightManager();
|
|
|
+ environmentManager = new EnvironmentManager()
|
|
|
+ {
|
|
|
+ PropManager = propManager,
|
|
|
+ // LightManager = lightManager
|
|
|
+ };
|
|
|
+
|
|
|
messageWindowManager = new MessageWindowManager();
|
|
|
- windowManager = new WindowManager(meidoManager, environmentManager, messageWindowManager);
|
|
|
|
|
|
- environmentManager.Initialize();
|
|
|
+ MaidSwitcherPane maidSwitcherPane = new MaidSwitcherPane(meidoManager);
|
|
|
|
|
|
- isActive = true;
|
|
|
+ windowManager = new WindowManager()
|
|
|
+ {
|
|
|
+ [Constants.Window.Main] = new MainWindow(meidoManager)
|
|
|
+ {
|
|
|
+ [Constants.Window.Call] = new CallWindowPane(meidoManager),
|
|
|
+ [Constants.Window.Pose] = new PoseWindowPane(meidoManager, maidSwitcherPane),
|
|
|
+ [Constants.Window.Face] = new FaceWindowPane(meidoManager, maidSwitcherPane),
|
|
|
+ [Constants.Window.BG] = new BGWindowPane(environmentManager),
|
|
|
+ [Constants.Window.BG2] = new BG2WindowPane(environmentManager)
|
|
|
+ },
|
|
|
+ [Constants.Window.Message] = new MessageWindow(messageWindowManager)
|
|
|
+ };
|
|
|
+
|
|
|
+ meidoManager.BeginCallMeidos += (s, a) => uiActive = false;
|
|
|
+ meidoManager.EndCallMeidos += (s, a) => uiActive = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Activate()
|
|
|
+ {
|
|
|
uiActive = true;
|
|
|
+ isActive = true;
|
|
|
|
|
|
- #region maid stuff
|
|
|
- // if (maid)
|
|
|
- // {
|
|
|
- // maid.StopKuchipakuPattern();
|
|
|
- // maid.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
|
|
|
-
|
|
|
- // if (maid.Visible && maid.body0.isLoadedBody)
|
|
|
- // {
|
|
|
- // maid.CrossFade("pose_taiki_f.anm", false, true, false, 0f);
|
|
|
- // maid.SetAutoTwistAll(true);
|
|
|
- // maid.body0.MuneYureL(1f);
|
|
|
- // maid.body0.MuneYureR(1f);
|
|
|
- // maid.body0.jbMuneL.enabled = true;
|
|
|
- // maid.body0.jbMuneR.enabled = true;
|
|
|
- // }
|
|
|
-
|
|
|
- // maid.body0.SetMask(TBody.SlotID.wear, true);
|
|
|
- // maid.body0.SetMask(TBody.SlotID.skirt, true);
|
|
|
- // maid.body0.SetMask(TBody.SlotID.bra, true);
|
|
|
- // maid.body0.SetMask(TBody.SlotID.panz, true);
|
|
|
- // maid.body0.SetMask(TBody.SlotID.mizugi, true);
|
|
|
- // maid.body0.SetMask(TBody.SlotID.onepiece, true);
|
|
|
- // if (maid.body0.isLoadedBody)
|
|
|
- // {
|
|
|
- // for (int i = 0; i < maid.body0.goSlot.Count; i++)
|
|
|
- // {
|
|
|
- // List<THair1> fieldValue = Utility.GetFieldValue<TBoneHair_, List<THair1>>(maid.body0.goSlot[i].bonehair, "hair1list");
|
|
|
- // for (int j = 0; j < fieldValue.Count; ++j)
|
|
|
- // {
|
|
|
- // fieldValue[j].SoftG = new Vector3(0.0f, -3f / 1000f, 0.0f);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- #endregion
|
|
|
+ meidoManager.Activate();
|
|
|
+ environmentManager.Activate();
|
|
|
+ windowManager.Activate();
|
|
|
+ messageWindowManager.Activate();
|
|
|
|
|
|
GameObject dailyPanel = GameObject.Find("UI Root").transform.Find("DailyPanel").gameObject;
|
|
|
dailyPanel.SetActive(false);
|
|
|
}
|
|
|
+
|
|
|
+ private void Deactivate()
|
|
|
+ {
|
|
|
+ if (meidoManager.IsBusy) return;
|
|
|
+
|
|
|
+ uiActive = false;
|
|
|
+ isActive = false;
|
|
|
+
|
|
|
+ meidoManager.Deactivate();
|
|
|
+ environmentManager.Deactivate();
|
|
|
+ messageWindowManager.Deactivate();
|
|
|
+ windowManager.Deactivate();
|
|
|
+
|
|
|
+ // GameMain.Instance.SoundMgr.PlayBGM("bgm009.ogg", 1f, true);
|
|
|
+ GameObject dailyPanel = GameObject.Find("UI Root").transform.Find("DailyPanel").gameObject;
|
|
|
+ dailyPanel.SetActive(true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|