public static void SetSlot(int fSlotNo)
        {
            bool flag = CommonUIData.slotNo != fSlotNo || fSlotNo == -2;

            if (flag)
            {
                CommonUIData.slotNo = fSlotNo;
                int num = CommonUIData.slotNo;
                if (num != -2)
                {
                    if (num != -1)
                    {
                        CommonUIData.SetObject(CommonUIData.maid.body0.goSlot[CommonUIData.slotNo].obj);
                    }
                    else
                    {
                        CommonUIData.SetObject(CommonUIData.maid.body0.m_Bones.gameObject);
                    }
                }
                else
                {
                    CommonUIData.SetObject(null);
                }
            }
        }
        public static void SetMaid(Maid fMaid)
        {
            bool flag = CommonUIData.maid != fMaid || fMaid == null;

            if (flag)
            {
                CommonUIData.maid = fMaid;
                CommonUIData.SetSlot(-2);
            }
        }
        public static void SetObject(GameObject fObj)
        {
            bool flag = CommonUIData.obj != fObj || fObj == null;

            if (flag)
            {
                CommonUIData.obj = fObj;
                CommonUIData.SetBone(null);
            }
        }
Esempio n. 4
0
 private void TargetObjectChangeCheck()
 {
     if (Setting.targetSelectMode == 0)
     {
         if (CommonUIData.maid == null || CommonUIData.slotNo == -2)
         {
             CommonUIData.SetObject(null);
         }
         else if (CommonUIData.slotNo == -1)
         {
             CommonUIData.SetObject(CommonUIData.maid.body0.m_Bones);
         }
         else
         {
             CommonUIData.SetObject(CommonUIData.maid.body0.goSlot[CommonUIData.slotNo].obj);
         }
     }
     if (!(this.targetObj == CommonUIData.obj) || (this.targetObj == null && this.braList != null))
     {
         this.targetObj = CommonUIData.obj;
         this.Clear();
         if (this.targetObj)
         {
             Transform[] fromBones;
             if (Setting.targetSelectMode == 0 && CommonUIData.slotNo == -1)
             {
                 fromBones = (from bone in CommonUIData.maid.body0.goSlot[0].obj.GetComponentInChildren <SkinnedMeshRenderer>().bones
                              where bone != null
                              select CMT.SearchObjName(CommonUIData.obj.transform, bone.name, true) into bone
                              where bone != null
                              select bone).ToArray <Transform>();
             }
             else
             {
                 SkinnedMeshRenderer componentInChildren = this.targetObj.GetComponentInChildren <SkinnedMeshRenderer>();
                 if (componentInChildren == null)
                 {
                     return;
                 }
                 fromBones = (from bone in componentInChildren.bones
                              where bone != null
                              select bone).ToArray <Transform>();
             }
             this.CopyBoneConstruction(this.targetObj.transform, fromBones);
         }
     }
 }