123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859 |
- using System;
- using System.Collections.Generic;
- using System.Runtime.CompilerServices;
- using UnityEngine;
- using wf;
- public class PlacementWindow : BaseMaidPhotoWindow
- {
- public override void Awake()
- {
- base.Awake();
- this.PartsTransForm.onChangeAxisVisibleType.Add(new Action(this.OnChangeAxisVisibleType));
- EventDelegate.Add(this.CameraFocusButton.onClick, new EventDelegate.Callback(this.OnClickCameraFocus));
- EventDelegate.Add(this.DeActiveButton.onClick, new EventDelegate.Callback(this.OnClickDeActive));
- this.VisibleCheckButton.onClick.Add(new Action<WFCheckBox>(this.OnClickVisibleCheckButton));
- this.camera_move_support_ = base.gameObject.AddComponent<WfCameraMoveSupport>();
- EventDelegate.Add(this.CallEditButton.onClick, delegate
- {
- base.mgr.CallEditSceneFunction(base.mgr.select_maid);
- });
- }
- public override void Start()
- {
- base.Start();
- this.chara_mgr_ = GameMain.Instance.CharacterMgr;
- List<Maid> list = new List<Maid>();
- for (int i = 0; i < this.chara_mgr_.GetStockMaidCount(); i++)
- {
- Maid stockMaid = this.chara_mgr_.GetStockMaid(i);
- if (!(stockMaid == null))
- {
- list.Add(stockMaid);
- }
- }
- List<Maid> list2 = list;
- if (PlacementWindow.<>f__mg$cache0 == null)
- {
- PlacementWindow.<>f__mg$cache0 = new Comparison<Maid>(CharacterSelectManager.SortMaidStandardNoSchedule);
- }
- list2.Sort(PlacementWindow.<>f__mg$cache0);
- for (int j = 0; j < this.chara_mgr_.GetManCount(); j++)
- {
- Maid man = this.chara_mgr_.GetMan(j);
- if (!(man == null) && !man.boNPC)
- {
- PhotoManEditManager.Controller controller = new PhotoManEditManager.Controller(man);
- if (j != 0)
- {
- man.SetUpModel("_I_man.menu");
- controller.color = new Color(0f, 0.09f, 1f);
- controller.fat = 0.2f;
- man.AllProcProp();
- }
- PlacementWindow.ManDataBackup value = default(PlacementWindow.ManDataBackup);
- value.color = controller.color;
- value.fat = controller.fat;
- value.parts_visible = true;
- value.head_item_rid = controller.head_menu_rid;
- this.man_backup_data_dic_.Add(man.status.guid, value);
- list.Add(man);
- }
- }
- UIGrid component = UTY.GetChildObject(this.content_game_object, "ListParent/Contents/UnitParent", false).GetComponent<UIGrid>();
- UIScrollView component2 = UTY.GetChildObject(this.content_game_object, "ListParent/Contents", false).GetComponent<UIScrollView>();
- for (int k = 0; k < list.Count; k++)
- {
- GameObject f_goParent = Utility.CreatePrefab(component.gameObject, "ScenePhotoMode/SimpleMaidPlatePlacement", true);
- PlacementWindow.PlateData plateData = new PlacementWindow.PlateData();
- plateData.maid = list[k];
- plateData.plate = UTY.GetChildObject(f_goParent, "Plate", false).GetComponent<SimpleMaidPlate>();
- plateData.plate.SetMaidData(list[k]);
- plateData.btn = UTY.GetChildObject(f_goParent, "Plate/Plate/TopButton", false).GetComponent<UIButton>();
- plateData.def_btn_color = new Color(1f, 1f, 1f, 0.7f);
- plateData.select_btn = UTY.GetChildObject(f_goParent, "Plate/Button", false).GetComponent<UIWFTabButton>();
- plateData.select_btn.isEnabled = false;
- EventDelegate.Add(plateData.select_btn.onClick, new EventDelegate.Callback(this.OnClickMaid));
- plateData.bg_sprite = UTY.GetChildObject(f_goParent, "Plate/Plate/BG", false).GetComponent<UISprite>();
- plateData.select_frame = UTY.GetChildObject(f_goParent, "Plate/Plate/SelectFrame", false).GetComponent<UISprite>();
- EventDelegate.Add(plateData.btn.onClick, new EventDelegate.Callback(this.OnClickPlacementBtn));
- this.maid_data_list_.Add(plateData);
- }
- component.Reposition();
- component2.ResetPosition();
- this.UpdateChildren();
- UIButtonColor cameraFocusButton = this.CameraFocusButton;
- bool flag = false;
- this.VisibleCheckButton.enabled = flag;
- flag = flag;
- this.DeActiveButton.isEnabled = flag;
- flag = flag;
- this.CallEditButton.isEnabled = flag;
- cameraFocusButton.isEnabled = flag;
- this.is_first_ = true;
- this.call_deserialize_ = false;
- }
- public void OnDestroy()
- {
- if (GameMain.Instance == null || GameMain.Instance.CharacterMgr == null)
- {
- return;
- }
- }
- public override void Update()
- {
- if (this.is_first_)
- {
- this.UpdateList();
- this.is_first_ = false;
- }
- if (Input.GetKeyDown(KeyCode.F1))
- {
- this.PartsTransForm.NextAxis();
- }
- if (Input.GetKeyDown(KeyCode.F2) && this.CameraFocusButton.isEnabled)
- {
- this.OnClickCameraFocus();
- }
- if (this.new_load_maid_data_list_.Count == 0 || this.chara_mgr_.IsBusy())
- {
- if (!this.chara_mgr_.IsBusy() && this.maid_casule_collider_hash_.Count != 0)
- {
- bool flag = false;
- using (Dictionary<int, CapsuleCollider>.Enumerator enumerator = this.maid_casule_collider_hash_.GetEnumerator())
- {
- if (enumerator.MoveNext())
- {
- KeyValuePair<int, CapsuleCollider> keyValuePair = enumerator.Current;
- flag = keyValuePair.Value.enabled;
- }
- }
- if (GameMain.Instance.VRMode)
- {
- if (!OvrIK.IsVRIKMode && !flag)
- {
- foreach (KeyValuePair<int, CapsuleCollider> keyValuePair2 in this.maid_casule_collider_hash_)
- {
- keyValuePair2.Value.enabled = true;
- }
- }
- }
- else if (Input.GetKey(KeyCode.Tab) && !flag)
- {
- foreach (KeyValuePair<int, CapsuleCollider> keyValuePair3 in this.maid_casule_collider_hash_)
- {
- keyValuePair3.Value.enabled = true;
- }
- }
- else if (!Input.GetKey(KeyCode.Tab) && flag)
- {
- foreach (KeyValuePair<int, CapsuleCollider> keyValuePair4 in this.maid_casule_collider_hash_)
- {
- keyValuePair4.Value.enabled = false;
- }
- }
- }
- return;
- }
- for (int i = 0; i < this.new_load_maid_data_list_.Count; i++)
- {
- PlacementWindow.MaidSlotData maidSlotData = this.new_load_maid_data_list_[i];
- Maid maid = maidSlotData.maid;
- this.active_maid_list_.Add(maidSlotData);
- maid.transform.position = Vector3.zero;
- maid.transform.rotation = default(Quaternion);
- maid.transform.localScale = Vector3.one;
- maid.body0.SetBoneHitHeightY(-1000f);
- base.mgr.OnMaidAddEvent(maid, this.call_deserialize_);
- }
- if (this.call_deserialize_)
- {
- base.mgr.OnFinishMaidDeserializeLoad();
- }
- this.call_deserialize_ = false;
- this.SetSelectMaid(this.new_load_maid_data_list_[0].maid);
- this.new_load_maid_data_list_.Clear();
- GameMain.Instance.MainCamera.FadeIn(0.3f, false, null, true, true, default(Color));
- }
- public int GetActiveMaidCount()
- {
- return this.active_maid_list_.Count;
- }
- private void SetSelectMaid(Maid maid)
- {
- if (maid == null)
- {
- base.mgr.OnMaidChangeEvent(null);
- return;
- }
- bool flag = false;
- for (int i = 0; i < this.GetMaidOrManCount(maid); i++)
- {
- if (this.GetMaidOrMan(maid, i) == maid)
- {
- flag = true;
- break;
- }
- }
- if (flag && maid.boMAN && !maid.Visible)
- {
- flag = false;
- }
- if (!flag)
- {
- return;
- }
- base.mgr.OnMaidChangeEvent(maid);
- this.UpdateList();
- }
- public override void OnMaidChangeEvent(Maid maid)
- {
- base.OnMaidChangeEvent(maid);
- UIButtonColor cameraFocusButton = this.CameraFocusButton;
- bool flag = maid != null;
- this.VisibleCheckButton.enabled = flag;
- flag = flag;
- this.DeActiveButton.isEnabled = flag;
- flag = flag;
- this.CallEditButton.isEnabled = flag;
- cameraFocusButton.isEnabled = flag;
- if (maid != null && maid.boMAN)
- {
- this.CallEditButton.isEnabled = false;
- }
- this.VisibleCheckButton.check = (maid != null && maid.transform.GetChild(0).localScale.x != 0f);
- if (maid != null)
- {
- this.PartsTransForm.SetObject(maid.gameObject);
- this.PartsTransForm.ScaleInput.SetInitVector(Vector3.one);
- }
- else
- {
- this.PartsTransForm.SetObject(null);
- }
- this.OnChangeAxisVisibleType();
- }
- public override void OnMaidRemoveEvent(Maid maid)
- {
- base.OnMaidRemoveEvent(maid);
- if (this.transtarget_maid_dic_.ContainsKey(maid))
- {
- this.transtarget_maid_dic_[maid].Delete();
- this.transtarget_maid_dic_.Remove(maid);
- }
- this.UpdateList();
- }
- public override void OnMaidAddEvent(Maid maid, bool is_deserialize_load)
- {
- base.OnMaidAddEvent(maid, is_deserialize_load);
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
- if (!is_deserialize_load)
- {
- maidStoreData["position"] = Vector3.zero.ToString();
- maidStoreData["rotation"] = Quaternion.identity.ToString();
- maidStoreData["scale"] = Vector3.one.ToString();
- maidStoreData["visible"] = true.ToString();
- }
- maid.transform.position = Parse.Vector3(maidStoreData["position"]);
- maid.transform.rotation = Parse.Quaternion(maidStoreData["rotation"]);
- maid.transform.localScale = Parse.Vector3(maidStoreData["scale"]);
- if (bool.Parse(maidStoreData["visible"]))
- {
- maid.transform.GetChild(0).localScale = Vector3.one;
- }
- else
- {
- maid.transform.GetChild(0).localScale = Vector3.zero;
- }
- this.transtarget_maid_dic_.Add(maid, new PhotoTransTargetObject(maid.gameObject, string.Empty, PhotoTransTargetObject.Type.Maid, new Vector2(this.PartsTransForm.ScaleInput.SliderMin, this.PartsTransForm.ScaleInput.SliderMax)));
- if (GameMain.Instance.VRMode)
- {
- MeshRenderer componentInChildren = this.transtarget_maid_dic_[maid].axis_obj.GetComponentInChildren<MeshRenderer>();
- if (componentInChildren != null)
- {
- componentInChildren.enabled = false;
- }
- BoxCollider[] componentsInChildren = this.transtarget_maid_dic_[maid].axis_obj.GetComponentsInChildren<BoxCollider>();
- foreach (BoxCollider boxCollider in componentsInChildren)
- {
- boxCollider.enabled = false;
- }
- }
- if (maid.boMAN)
- {
- return;
- }
- MaidColliderCollect maidColliderCollect = MaidColliderCollect.AddColliderCollect(maid);
- List<CapsuleCollider> list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Grab);
- for (int j = 0; j < list.Count; j++)
- {
- ColliderEvent colliderEvent = list[j].gameObject.AddComponent<ColliderEvent>();
- colliderEvent.onMouseUp = new Action(maid.OnMouseUp);
- this.maid_casule_collider_hash_.Add(list[j].GetInstanceID(), list[j]);
- }
- using (Dictionary<int, CapsuleCollider>.Enumerator enumerator = this.maid_casule_collider_hash_.GetEnumerator())
- {
- if (enumerator.MoveNext())
- {
- KeyValuePair<int, CapsuleCollider> keyValuePair = enumerator.Current;
- keyValuePair.Value.enabled = true;
- }
- }
- maid.onMouseUpEvent = new Action<Maid>(this.OnMouseUpFromMaid);
- }
- private void OnMouseUpFromMaid(Maid maid)
- {
- if (Input.GetKey(KeyCode.Tab) && base.mgr.select_maid != maid)
- {
- this.SetSelectMaid(maid);
- MouseExposition @object = MouseExposition.GetObject();
- string draw_text = maid.status.firstName + " " + maid.status.lastName + "を選択しました";
- @object.SetText(draw_text, 2f);
- }
- }
- private void UpdateList()
- {
- HashSet<string> hashSet = new HashSet<string>();
- for (int i = 0; i < this.chara_mgr_.GetMaidCount(); i++)
- {
- Maid maid = this.chara_mgr_.GetMaid(i);
- if (!(maid == null))
- {
- if (!hashSet.Contains(maid.status.guid))
- {
- hashSet.Add(maid.status.guid);
- }
- }
- }
- for (int j = 0; j < this.chara_mgr_.GetManCount(); j++)
- {
- Maid man = this.chara_mgr_.GetMan(j);
- if (!(man == null) && man.Visible)
- {
- if (!hashSet.Contains(man.status.guid))
- {
- hashSet.Add(man.status.guid);
- }
- }
- }
- for (int k = 0; k < this.maid_data_list_.Count; k++)
- {
- if (hashSet.Contains(this.maid_data_list_[k].maid.status.guid))
- {
- this.maid_data_list_[k].btn.isEnabled = false;
- this.maid_data_list_[k].select_btn.isEnabled = true;
- if (base.mgr.select_maid == this.maid_data_list_[k].maid)
- {
- this.maid_data_list_[k].select_btn.SetSelect(true);
- }
- else
- {
- this.maid_data_list_[k].select_btn.SetSelect(false);
- }
- }
- else
- {
- this.maid_data_list_[k].btn.isEnabled = true;
- this.maid_data_list_[k].select_btn.SetSelect(false);
- this.maid_data_list_[k].select_btn.isEnabled = false;
- }
- }
- }
- public void OnClickMaid()
- {
- if (this.chara_mgr_.IsBusy())
- {
- return;
- }
- PlacementWindow.PlateData plateData = null;
- for (int i = 0; i < this.maid_data_list_.Count; i++)
- {
- if (this.maid_data_list_[i].select_btn == UIButton.current)
- {
- plateData = this.maid_data_list_[i];
- break;
- }
- }
- if (plateData == null)
- {
- return;
- }
- this.SetSelectMaid(plateData.maid);
- }
- private void OnClickPlacementBtn()
- {
- if (this.chara_mgr_.IsBusy())
- {
- return;
- }
- PlacementWindow.PlateData plateData = null;
- for (int i = 0; i < this.maid_data_list_.Count; i++)
- {
- if (!(UIButton.current != this.maid_data_list_[i].btn))
- {
- plateData = this.maid_data_list_[i];
- break;
- }
- }
- bool flag = false;
- for (int j = 0; j < this.GetMaidOrManCount(plateData.maid); j++)
- {
- if (this.GetMaidOrMan(plateData.maid, j) == plateData.maid)
- {
- flag = true;
- break;
- }
- }
- if (flag && plateData.maid.boMAN && !plateData.maid.Visible)
- {
- flag = false;
- }
- if (flag)
- {
- this.DeActiveMaid(plateData.maid, false);
- }
- else
- {
- int num = 0;
- if (!plateData.maid.boMAN)
- {
- for (int k = 0; k < this.GetMaidOrManCount(plateData.maid); k++)
- {
- num += ((!(this.GetMaidOrMan(plateData.maid, k) != null)) ? 0 : 1);
- }
- }
- else
- {
- for (int l = 0; l < this.GetMaidOrManCount(plateData.maid); l++)
- {
- if (this.GetMaidOrMan(plateData.maid, l) != null && plateData.maid.Visible)
- {
- num++;
- }
- }
- }
- if (!plateData.maid.boMAN && 12 <= num)
- {
- GameMain.Instance.SysDlg.Show("これ以上メイドを配置する事はできません", SystemDialog.TYPE.OK, null, null);
- }
- else if (plateData.maid.boMAN && 5 <= num)
- {
- GameMain.Instance.SysDlg.Show("これ以上男を配置する事はできません", SystemDialog.TYPE.OK, null, null);
- }
- else
- {
- this.ActiveMaid(plateData.maid);
- }
- }
- }
- private void ActiveMaid(Maid maid)
- {
- if (maid == null)
- {
- return;
- }
- List<PlacementWindow.MaidSlotData> list = new List<PlacementWindow.MaidSlotData>();
- uint num = 0u;
- for (int i = 0; i < this.active_maid_list_.Count; i++)
- {
- if (this.active_maid_list_[i].maid == maid)
- {
- list.Add(this.active_maid_list_[i]);
- }
- if (num < this.active_maid_list_[i].sort_no)
- {
- num = this.active_maid_list_[i].sort_no;
- }
- }
- for (int j = 0; j < list.Count; j++)
- {
- this.active_maid_list_.Remove(list[j]);
- }
- this.active_maid_list_.Sort();
- int k = 0;
- while (k < this.GetMaidOrManCount(maid))
- {
- if (!maid.boMAN)
- {
- if (!(this.GetMaidOrMan(maid, k) != null))
- {
- goto IL_107;
- }
- }
- else if (!(this.GetMaidOrMan(maid, k) != maid))
- {
- goto IL_107;
- }
- k++;
- continue;
- IL_107:
- this.SetActiveMaidOrMan(maid, k);
- maid.Visible = true;
- maid.AllProcPropSeqStart();
- PlacementWindow.MaidSlotData maidSlotData = new PlacementWindow.MaidSlotData();
- maidSlotData.maid = maid;
- maidSlotData.sort_no = num + 1u;
- maidSlotData.slot_no = k;
- this.new_load_maid_data_list_.Add(maidSlotData);
- break;
- }
- if (this.chara_mgr_.IsBusy())
- {
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- }
- }
- public void DeActiveMaid(Maid maid, bool on_reset_call = false)
- {
- if (this.chara_mgr_.IsBusy() || maid == null)
- {
- return;
- }
- List<PlacementWindow.MaidSlotData> list = new List<PlacementWindow.MaidSlotData>();
- for (int i = 0; i < this.active_maid_list_.Count; i++)
- {
- if (this.active_maid_list_[i].maid == maid)
- {
- list.Add(this.active_maid_list_[i]);
- }
- }
- bool flag = false;
- for (int j = 0; j < list.Count; j++)
- {
- if (list[j].maid == base.mgr.select_maid)
- {
- flag = true;
- }
- this.active_maid_list_.Remove(list[j]);
- }
- this.active_maid_list_.Sort();
- if (flag)
- {
- if (0 < this.active_maid_list_.Count && !on_reset_call)
- {
- this.SetSelectMaid(this.active_maid_list_[0].maid);
- }
- else
- {
- this.SetSelectMaid(null);
- }
- }
- for (int k = 0; k < this.GetMaidOrManCount(maid); k++)
- {
- Maid maidOrMan = this.GetMaidOrMan(maid, k);
- if (maidOrMan == maid)
- {
- maidOrMan.transform.position = Vector3.zero;
- maidOrMan.transform.rotation = Quaternion.identity;
- maidOrMan.transform.localScale = Vector3.one;
- maidOrMan.transform.GetChild(0).localScale = Vector3.one;
- maidOrMan.ResetAll();
- CapsuleCollider[] componentsInChildren = maid.GetComponentsInChildren<CapsuleCollider>();
- if (componentsInChildren.Length == 0)
- {
- this.maid_casule_collider_hash_.Clear();
- }
- for (int l = 0; l < componentsInChildren.Length; l++)
- {
- this.maid_casule_collider_hash_.Remove(componentsInChildren[l].GetInstanceID());
- ColliderEvent component = componentsInChildren[l].GetComponent<ColliderEvent>();
- if (component != null)
- {
- UnityEngine.Object.Destroy(component);
- }
- UnityEngine.Object.Destroy(componentsInChildren[l]);
- }
- maid.onMouseUpEvent = null;
- base.mgr.OnMaidRemoveEventPrev(maid);
- if (!maid.boMAN)
- {
- this.DeactivateMaidOrMan(maid);
- }
- else
- {
- int m;
- for (m = 0; m < this.chara_mgr_.GetManCount(); m++)
- {
- if (this.chara_mgr_.GetMan(m) == maid)
- {
- break;
- }
- }
- this.chara_mgr_.CharaVisible(m, false, true);
- }
- base.mgr.OnMaidRemoveEvent(maid);
- break;
- }
- }
- }
- protected void OnChangeAxisVisibleType()
- {
- WindowPartsTransform.AxisVisibleType axis_visible_type = this.PartsTransForm.axis_visible_type;
- PhotoTransTargetObject photoTransTargetObject = null;
- foreach (KeyValuePair<Maid, PhotoTransTargetObject> keyValuePair in this.transtarget_maid_dic_)
- {
- if (keyValuePair.Value.axis_obj != null)
- {
- keyValuePair.Value.axis_obj.Visible = false;
- }
- if (keyValuePair.Value.rotate_obj != null)
- {
- keyValuePair.Value.rotate_obj.Visible = false;
- }
- }
- if (base.mgr.select_maid != null)
- {
- photoTransTargetObject = this.transtarget_maid_dic_[base.mgr.select_maid];
- }
- if (photoTransTargetObject == null || photoTransTargetObject.obj == null || photoTransTargetObject.axis_obj == null)
- {
- return;
- }
- if (axis_visible_type == WindowPartsTransform.AxisVisibleType.UnVisible)
- {
- photoTransTargetObject.axis_obj.Visible = false;
- photoTransTargetObject.rotate_obj.Visible = false;
- }
- else if (axis_visible_type == WindowPartsTransform.AxisVisibleType.Position)
- {
- photoTransTargetObject.axis_obj.Visible = true;
- photoTransTargetObject.rotate_obj.Visible = false;
- }
- else if (axis_visible_type == WindowPartsTransform.AxisVisibleType.Rotate)
- {
- photoTransTargetObject.axis_obj.Visible = false;
- photoTransTargetObject.rotate_obj.Visible = true;
- }
- }
- public void OnClickVisibleCheckButton(WFCheckBox check_box)
- {
- if (base.mgr.select_maid == null)
- {
- return;
- }
- if (check_box.check)
- {
- base.mgr.select_maid.gameObject.transform.GetChild(0).localScale = Vector3.one;
- }
- else
- {
- base.mgr.select_maid.gameObject.transform.GetChild(0).localScale = Vector3.zero;
- }
- }
- public void OnClickCameraFocus()
- {
- if (base.mgr.select_maid == null || base.mgr.select_maid.body0 == null)
- {
- return;
- }
- Transform bone;
- if (!base.mgr.select_maid.boMAN)
- {
- bone = base.mgr.select_maid.body0.GetBone("Bip01 Head");
- }
- else
- {
- bone = base.mgr.select_maid.body0.GetBone("ManBip Head");
- }
- Vector3 position = bone.position;
- float distance = 1.6f;
- Vector2 aroundAngle = new Vector2(-180f, 4.7f);
- this.camera_move_support_.StartCameraPosition(position, distance, aroundAngle);
- }
- public void OnClickDeActive()
- {
- this.DeActiveMaid(base.mgr.select_maid, false);
- }
- public override void OnReset()
- {
- for (int i = 0; i < this.chara_mgr_.GetMaidCount(); i++)
- {
- if (this.chara_mgr_.GetMaid(i) != null)
- {
- this.DeActiveMaid(this.chara_mgr_.GetMaid(i), true);
- }
- }
- for (int j = 0; j < this.chara_mgr_.GetManCount(); j++)
- {
- if (this.chara_mgr_.GetMan(j) != null && this.chara_mgr_.GetMan(j).Visible)
- {
- this.DeActiveMaid(this.chara_mgr_.GetMan(j), true);
- }
- }
- }
- public override void OnDeserializeEvent()
- {
- List<string> maidStoreGuidList = base.mgr.GetMaidStoreGuidList();
- for (int i = 0; i < maidStoreGuidList.Count; i++)
- {
- this.call_deserialize_ = true;
- Maid maid = GameMain.Instance.CharacterMgr.GetStockMaid(maidStoreGuidList[i]);
- if (maid == null)
- {
- maid = GameMain.Instance.CharacterMgr.GetStockMan(maidStoreGuidList[i]);
- }
- maid.transform.position = Vector3.zero;
- maid.transform.rotation = Quaternion.identity;
- maid.transform.localScale = Vector3.one;
- maid.transform.GetChild(0).localScale = Vector3.one;
- this.ActiveMaid(maid);
- }
- }
- private int GetMaidOrManCount(Maid maid)
- {
- return maid.boMAN ? this.chara_mgr_.GetManCount() : this.chara_mgr_.GetMaidCount();
- }
- private Maid GetMaidOrMan(Maid maid, int slot_no)
- {
- return maid.boMAN ? this.chara_mgr_.GetMan(slot_no) : this.chara_mgr_.GetMaid(slot_no);
- }
- private void SetActiveMaidOrMan(Maid maid, int slot_no)
- {
- if (!maid.boMAN)
- {
- this.chara_mgr_.SetActiveMaid(maid, slot_no);
- }
- else
- {
- this.chara_mgr_.SetActiveMan(maid, slot_no);
- }
- }
- private void DeactivateMaidOrMan(Maid maid)
- {
- if (!maid.boMAN)
- {
- this.chara_mgr_.DeactivateMaid(maid);
- }
- else
- {
- this.chara_mgr_.DeactivateMan(maid);
- }
- }
- public Dictionary<string, PlacementWindow.ManDataBackup> man_backup_data_dic
- {
- get
- {
- return this.man_backup_data_dic_;
- }
- }
- public List<Maid> maid_list
- {
- get
- {
- List<Maid> list = new List<Maid>();
- foreach (PlacementWindow.PlateData plateData in this.maid_data_list_)
- {
- list.Add(plateData.maid);
- }
- return list;
- }
- }
- public WindowPartsTransform PartsTransForm;
- public UIButton CameraFocusButton;
- public WFCheckBox VisibleCheckButton;
- public UIButton DeActiveButton;
- public UIButton CallEditButton;
- private bool is_first_;
- private WfCameraMoveSupport camera_move_support_;
- private CharacterMgr chara_mgr_;
- private List<PlacementWindow.PlateData> maid_data_list_ = new List<PlacementWindow.PlateData>();
- private List<PlacementWindow.MaidSlotData> active_maid_list_ = new List<PlacementWindow.MaidSlotData>();
- private Dictionary<Maid, PhotoTransTargetObject> transtarget_maid_dic_ = new Dictionary<Maid, PhotoTransTargetObject>();
- private Dictionary<int, CapsuleCollider> maid_casule_collider_hash_ = new Dictionary<int, CapsuleCollider>();
- private bool call_deserialize_;
- private List<PlacementWindow.MaidSlotData> new_load_maid_data_list_ = new List<PlacementWindow.MaidSlotData>();
- private Dictionary<string, PlacementWindow.ManDataBackup> man_backup_data_dic_ = new Dictionary<string, PlacementWindow.ManDataBackup>();
- [CompilerGenerated]
- private static Comparison<Maid> <>f__mg$cache0;
- public struct ManDataBackup
- {
- public Color color;
- public float fat;
- public bool parts_visible;
- public int head_item_rid;
- }
- private class PlateData
- {
- public Maid maid;
- public Color def_btn_color;
- public SimpleMaidPlate plate;
- public UIButton btn;
- public UIWFTabButton select_btn;
- public UISprite bg_sprite;
- public UISprite select_frame;
- }
- private class MaidSlotData : IComparable
- {
- public int CompareTo(object obj)
- {
- if (obj == null)
- {
- return 1;
- }
- if (base.GetType() != obj.GetType())
- {
- NDebug.Assert("error", false);
- }
- return this.sort_no.CompareTo(((PlacementWindow.MaidSlotData)obj).sort_no);
- }
- public Maid maid;
- public uint sort_no;
- public int slot_no;
- }
- }
|