Beispiel #1
0
        private void DrawObject()
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            bool flag = CommonUIData.obj;

            if (flag)
            {
                string name = CommonUIData.obj.name;
            }
            GUILayout.Label("オブジェクト:", UIParams.Instance.lStyle, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            this.objectSelectUI.DrawCombo();
            bool flag2 = !CommonUIData.obj || !BackUpData.GetObjectDataExist(CommonUIData.obj);

            if (flag2)
            {
                GUI.enabled = false;
            }
            bool flag3 = GUILayout.Button("R", UIParams.Instance.bStyle, new GUILayoutOption[0]);

            if (flag3)
            {
                BackUpData.RestoreObject(CommonUIData.obj);
                BackUpData.Refresh();
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();
            UIUtil.BeginIndentArea();
            this.DrawImportExport();
            UIUtil.EndoIndentArea();
            UIUtil.BeginIndentArea();
            this.DrawBone();
            UIUtil.EndoIndentArea();
        }
        private static XElement GetMaidData(Maid maid)
        {
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData == null;
            XElement       result;

            if (flag)
            {
                result = null;
            }
            else
            {
                XElement xelement  = new XElement("Maid");
                XElement xelement2 = new XElement("GUID");
                xelement2.Add(maid.status.guid);
                XElement xelement3 = new XElement("Name");
                xelement3.Add(maid.status.fullNameJpStyle);
                xelement.Add(xelement2);
                xelement.Add(xelement3);
                XElement xelement4 = new XElement("Slots");
                foreach (int slotID in orNullMaidData.slotDataDic.Keys)
                {
                    XElement slotData = SceneDataManager.GetSlotData(maid, slotID);
                    bool     flag2    = slotData == null;
                    if (!flag2)
                    {
                        xelement4.Add(slotData);
                    }
                }
                xelement.Add(xelement4);
                result = xelement;
            }
            return(result);
        }
Beispiel #3
0
        public static void RestoreObject(Maid maid, int slotNo, GameObject obj)
        {
            BackUpObjectData orNullMaidObjectData = BackUpData.GetOrNullMaidObjectData(maid, slotNo, obj);
            bool             flag = orNullMaidObjectData == null;

            if (!flag)
            {
                bool changedYure = orNullMaidObjectData.changedYure;
                if (changedYure)
                {
                    bool flag2 = slotNo != -1;
                    if (flag2)
                    {
                        YureUtil.SetYureState(maid, slotNo, orNullMaidObjectData.bYure);
                    }
                }
                List <Transform> list = new List <Transform>(orNullMaidObjectData.boneDataDic.Keys);
                foreach (Transform transform in list)
                {
                    bool flag3 = !transform;
                    if (!flag3)
                    {
                        BackUpData.RestoreBone(maid, slotNo, obj, transform);
                    }
                }
                BackUpSlotData orNullMaidSlotData = BackUpData.GetOrNullMaidSlotData(maid, slotNo);
                orNullMaidSlotData.objectDataDic.Remove(obj);
            }
        }
        private void ResetTransform()
        {
            Transform      bone = CommonUIData.bone;
            BackUpBoneData orNullMaidBoneData = BackUpData.GetOrNullMaidBoneData(CommonUIData.maid, CommonUIData.slotNo, CommonUIData.obj, bone);
            bool           flag = orNullMaidBoneData == null;

            if (!flag)
            {
                bool changedPos = orNullMaidBoneData.changedPos;
                if (changedPos)
                {
                    bone.localPosition = orNullMaidBoneData.position;
                }
                bool changedRot = orNullMaidBoneData.changedRot;
                if (changedRot)
                {
                    bone.localRotation = orNullMaidBoneData.rotation;
                }
                bool changedScl = orNullMaidBoneData.changedScl;
                if (changedScl)
                {
                    bone.localScale = orNullMaidBoneData.scale;
                }
                BackUpData.GetOrNullMaidObjectData(CommonUIData.maid, CommonUIData.slotNo, CommonUIData.obj).boneDataDic.Remove(bone);
            }
        }
Beispiel #5
0
        private void DrawSlot()
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("スロット:", UIParams.Instance.lStyle, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            this.slotSelectUI.DrawCombo();
            bool flag = CommonUIData.slotNo == -2 || !BackUpData.GetMaidSlotDataExist(CommonUIData.maid, CommonUIData.slotNo);

            if (flag)
            {
                GUI.enabled = false;
            }
            bool flag2 = GUILayout.Button("R", UIParams.Instance.bStyle, new GUILayoutOption[0]);

            if (flag2)
            {
                BackUpData.RestoreSlot(CommonUIData.maid, CommonUIData.slotNo);
                BackUpData.Refresh();
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();
            UIUtil.BeginIndentArea();
            this.DrawObject();
            UIUtil.EndoIndentArea();
        }
Beispiel #6
0
        public static void RestoreBone(GameObject obj, Transform bone)
        {
            BackUpBoneData orNullBoneData = BackUpData.GetOrNullBoneData(obj, bone);
            bool           flag           = orNullBoneData == null;

            if (!flag)
            {
                bool changedPos = orNullBoneData.changedPos;
                if (changedPos)
                {
                    bone.localPosition = orNullBoneData.position;
                }
                bool changedRot = orNullBoneData.changedRot;
                if (changedRot)
                {
                    bone.localRotation = orNullBoneData.rotation;
                }
                bool changedScl = orNullBoneData.changedScl;
                if (changedScl)
                {
                    bone.localScale = orNullBoneData.scale;
                }
                BackUpObjectData orNullObjectData = BackUpData.GetOrNullObjectData(obj);
                orNullObjectData.boneDataDic.Remove(bone);
            }
        }
Beispiel #7
0
        public static bool GetMaidBoneDataExist(Maid maid, int slotNo, GameObject obj, Transform bone)
        {
            bool flag = !BackUpData.GetMaidDataExist(maid);
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = !BackUpData.GetMaidSlotDataExist(maid, slotNo);
                if (flag2)
                {
                    result = false;
                }
                else
                {
                    bool flag3 = !BackUpData.GetMaidObjectDataExist(maid, slotNo, obj);
                    if (flag3)
                    {
                        result = false;
                    }
                    else
                    {
                        bool flag4 = !BackUpData.maidDataDic[maid].slotDataDic[slotNo].objectDataDic[obj].boneDataDic.ContainsKey(bone);
                        result = !flag4;
                    }
                }
            }
            return(result);
        }
Beispiel #8
0
        private void DrawBone()
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            string str  = "未選択";
            bool   flag = CommonUIData.bone;

            if (flag)
            {
                str = CommonUIData.bone.name;
            }
            GUILayout.Label("ボーン:" + str, UIParams.Instance.lStyle, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            bool flag2 = !CommonUIData.bone || !BackUpData.GetMaidBoneDataExist(CommonUIData.maid, CommonUIData.slotNo, CommonUIData.obj, CommonUIData.bone);

            if (flag2)
            {
                GUI.enabled = false;
            }
            bool flag3 = GUILayout.Button("R", UIParams.Instance.bStyle, new GUILayoutOption[0]);

            if (flag3)
            {
                BackUpData.RestoreBone(CommonUIData.maid, CommonUIData.slotNo, CommonUIData.obj, CommonUIData.bone);
                BackUpData.Refresh();
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();
            UIUtil.BeginIndentArea();
            this.DrawTransform();
            UIUtil.EndoIndentArea();
        }
        public void Draw()
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            bool flag = BackUpData.maidDataDic.Count == 0 && BackUpData.objectDataDic.Count == 0;

            if (flag)
            {
                GUI.enabled = false;
            }
            bool flag2 = GUILayout.Button("リセット", UIParams.Instance.bStyle, new GUILayoutOption[0]);

            if (flag2)
            {
                BackUpData.Restore();
            }
            GUI.enabled = true;
            GUILayout.FlexibleSpace();
            bool flag3 = GUILayout.Button("終了", UIParams.Instance.bStyle, new GUILayoutOption[0]);

            if (flag3)
            {
                CommonUIData.maid   = null;
                CommonUIData.slotNo = -2;
                CommonUIData.obj    = null;
                CommonUIData.bone   = null;
                this.window.SetVisible(false);
            }
            GUILayout.EndHorizontal();
        }
        public static void SetSceneXmlData(XElement xmlData)
        {
            BackUpData.Refresh();
            XElement xelement = xmlData.Element("Maids");
            bool     flag     = xelement == null;

            if (!flag)
            {
                SceneDataManager.SetMaidListData(xelement);
            }
        }
Beispiel #11
0
        public static BackUpSlotData GetOrNullMaidSlotData(Maid maid, int slotNo)
        {
            BackUpSlotData result         = null;
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData != null && orNullMaidData.slotDataDic.ContainsKey(slotNo);

            if (flag)
            {
                result = orNullMaidData.slotDataDic[slotNo];
            }
            return(result);
        }
Beispiel #12
0
        public static BackUpObjectData GetOrNullMaidObjectData(Maid maid, int slotNo, GameObject obj)
        {
            BackUpObjectData result             = null;
            BackUpSlotData   orNullMaidSlotData = BackUpData.GetOrNullMaidSlotData(maid, slotNo);
            bool             flag = orNullMaidSlotData != null && orNullMaidSlotData.objectDataDic.ContainsKey(obj);

            if (flag)
            {
                result = orNullMaidSlotData.objectDataDic[obj];
            }
            return(result);
        }
Beispiel #13
0
        public static void RestoreMaid(Maid maid)
        {
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData == null;

            if (!flag)
            {
                List <int> list = new List <int>(orNullMaidData.slotDataDic.Keys);
                foreach (int slotNo in list)
                {
                    BackUpData.RestoreSlot(maid, slotNo);
                }
                BackUpData.maidDataDic.Remove(maid);
            }
        }
Beispiel #14
0
        public static void RefreshMaid(Maid maid)
        {
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData == null;

            if (!flag)
            {
                foreach (int slotNo in orNullMaidData.slotDataDic.Keys)
                {
                    BackUpData.RefreshSlot(maid, slotNo);
                }
                orNullMaidData.slotDataDic = (from kvp in orNullMaidData.slotDataDic
                                              where kvp.Value.objectDataDic.Count != 0
                                              select kvp).ToDictionary((KeyValuePair <int, BackUpSlotData> kvp) => kvp.Key, (KeyValuePair <int, BackUpSlotData> kvp) => kvp.Value);
            }
        }
Beispiel #15
0
        public static bool GetBoneDataExist(GameObject obj, Transform bone)
        {
            bool flag = !BackUpData.GetObjectDataExist(obj);
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = !BackUpData.objectDataDic[obj].boneDataDic.ContainsKey(bone);
                result = !flag2;
            }
            return(result);
        }
Beispiel #16
0
        public static void RefreshSlot(Maid maid, int slotNo)
        {
            BackUpSlotData orNullMaidSlotData = BackUpData.GetOrNullMaidSlotData(maid, slotNo);
            bool           flag = orNullMaidSlotData == null;

            if (!flag)
            {
                foreach (GameObject obj in orNullMaidSlotData.objectDataDic.Keys)
                {
                    BackUpData.RefreshObject(maid, slotNo, obj);
                }
                orNullMaidSlotData.objectDataDic = (from kvp in orNullMaidSlotData.objectDataDic
                                                    where kvp.Key != null && (kvp.Value.changedYure || kvp.Value.boneDataDic.Count != 0)
                                                    select kvp).ToDictionary((KeyValuePair <GameObject, BackUpObjectData> kvp) => kvp.Key, (KeyValuePair <GameObject, BackUpObjectData> kvp) => kvp.Value);
            }
        }
Beispiel #17
0
        public static bool GetMaidSlotDataExist(Maid maid, int slotNo)
        {
            bool flag = !BackUpData.GetMaidDataExist(maid);
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = !BackUpData.maidDataDic[maid].slotDataDic.ContainsKey(slotNo);
                result = !flag2;
            }
            return(result);
        }
Beispiel #18
0
        private void DrawYure()
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("揺れボーン", UIParams.Instance.lStyle, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            bool flag = !YureUtil.GetYureAble(CommonUIData.maid, CommonUIData.slotNo);

            if (flag)
            {
                GUI.enabled = false;
                GUILayout.Toggle(false, "", UIParams.Instance.tStyle, new GUILayoutOption[0]);
                GUI.enabled = true;
            }
            else
            {
                bool yureState = YureUtil.GetYureState(CommonUIData.maid, CommonUIData.slotNo);
                bool flag2     = GUILayout.Toggle(yureState, "", UIParams.Instance.tStyle, new GUILayoutOption[0]);
                bool flag3     = flag2 != yureState;
                if (flag3)
                {
                    YureUtil.SetYureState(CommonUIData.maid, CommonUIData.slotNo, flag2);
                    BackUpObjectData orAddMaidObjectData = BackUpData.GetOrAddMaidObjectData(CommonUIData.maid, CommonUIData.slotNo, CommonUIData.obj);
                    bool             flag4 = orAddMaidObjectData.changedYure && flag2 == orAddMaidObjectData.bYure;
                    if (flag4)
                    {
                        bool flag5 = orAddMaidObjectData.boneDataDic.Count == 0;
                        if (flag5)
                        {
                            BackUpSlotData orNullMaidSlotData = BackUpData.GetOrNullMaidSlotData(CommonUIData.maid, CommonUIData.slotNo);
                            orNullMaidSlotData.objectDataDic.Remove(CommonUIData.obj);
                        }
                        else
                        {
                            orAddMaidObjectData.changedYure = false;
                        }
                        BackUpData.Refresh();
                    }
                    else
                    {
                        orAddMaidObjectData.changedYure = true;
                        orAddMaidObjectData.bYure       = yureState;
                    }
                }
            }
            GUILayout.EndHorizontal();
        }
Beispiel #19
0
        private void GizmoDragEnd()
        {
            int selectedType = this.bgr.GetSelectedType();

            if (selectedType > 0 && selectedType <= 21)
            {
                int            targetSelectMode = Setting.targetSelectMode;
                BackUpBoneData backUpBoneData;
                if (targetSelectMode != 0)
                {
                    if (targetSelectMode != 1)
                    {
                        return;
                    }
                    backUpBoneData = BackUpData.GetOrAddBoneData(CommonUIData.obj, CommonUIData.bone);
                }
                else
                {
                    backUpBoneData = BackUpData.GetOrAddMaidBoneData(CommonUIData.maid, CommonUIData.slotNo, CommonUIData.obj, CommonUIData.bone);
                }
                if (selectedType <= 9)
                {
                    if (!backUpBoneData.changedPos)
                    {
                        backUpBoneData.position   = this.bgr.GetBackUpLocalPosition();
                        backUpBoneData.changedPos = true;
                        return;
                    }
                }
                else if (selectedType > 9 && selectedType <= 12)
                {
                    if (!backUpBoneData.changedRot)
                    {
                        backUpBoneData.rotation   = this.bgr.GetBackUpLocalRotation();
                        backUpBoneData.changedRot = true;
                        return;
                    }
                }
                else if (selectedType > 12 && !backUpBoneData.changedScl)
                {
                    backUpBoneData.scale      = this.bgr.GetBackUpLocalScale();
                    backUpBoneData.changedScl = true;
                }
            }
        }
Beispiel #20
0
        public static void RestoreObject(GameObject obj)
        {
            BackUpObjectData orNullObjectData = BackUpData.GetOrNullObjectData(obj);
            bool             flag             = orNullObjectData == null;

            if (!flag)
            {
                List <Transform> list = new List <Transform>(orNullObjectData.boneDataDic.Keys);
                foreach (Transform transform in list)
                {
                    bool flag2 = !transform;
                    if (!flag2)
                    {
                        BackUpData.RestoreBone(obj, transform);
                    }
                }
                BackUpData.objectDataDic.Remove(obj);
            }
        }
Beispiel #21
0
        public static void RestoreSlot(Maid maid, int slotNo)
        {
            BackUpSlotData orNullMaidSlotData = BackUpData.GetOrNullMaidSlotData(maid, slotNo);
            bool           flag = orNullMaidSlotData == null;

            if (!flag)
            {
                List <GameObject> list = new List <GameObject>(orNullMaidSlotData.objectDataDic.Keys);
                foreach (GameObject gameObject in list)
                {
                    bool flag2 = !gameObject;
                    if (!flag2)
                    {
                        BackUpData.RestoreObject(maid, slotNo, gameObject);
                    }
                }
                BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
                orNullMaidData.slotDataDic.Remove(slotNo);
            }
        }
Beispiel #22
0
        public static void RestoreScale(GameObject obj, Transform bone)
        {
            BackUpBoneData orNullBoneData = BackUpData.GetOrNullBoneData(obj, bone);
            bool           flag           = orNullBoneData == null;

            if (!flag)
            {
                bool changedScl = orNullBoneData.changedScl;
                if (changedScl)
                {
                    bone.localScale = orNullBoneData.scale;
                    bool flag2 = orNullBoneData.changedPos || orNullBoneData.changedRot;
                    if (flag2)
                    {
                        orNullBoneData.changedScl = false;
                    }
                    else
                    {
                        BackUpData.GetOrNullObjectData(obj).boneDataDic.Remove(bone);
                    }
                }
            }
        }