Exemplo n.º 1
0
        public static OCICharFemale Add(string _path)
        {
            ChaControl chara = Singleton <Character> .Instance.CreateChara((byte)1, Singleton <Scene> .Instance.commonSpace, -1, (ChaFileControl)null);

            chara.chaFile.LoadCharaFile(_path, byte.MaxValue, true, true);
            chara.fileStatus.neckLookPtn = 3;
            OICharInfo _info = new OICharInfo(chara.chaFile, Studio.Studio.GetNewIndex());

            return(AddObjectFemale.Add(chara, _info, (ObjectCtrlInfo)null, (TreeNodeObject)null, true, Studio.Studio.optionSystem.initialPosition));
        }
Exemplo n.º 2
0
        public static void LoadChild(
            BinaryReader _reader,
            Version _version,
            List <ObjectInfo> _list,
            bool _import)
        {
            int num1 = _reader.ReadInt32();

            for (int index = 0; index < num1; ++index)
            {
                int num2 = _reader.ReadInt32();
                switch (num2)
                {
                case 0:
                    OICharInfo oiCharInfo = new OICharInfo((ChaFileControl)null, _import ? Studio.Studio.GetNewIndex() : -1);
                    oiCharInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiCharInfo);
                    break;

                case 1:
                    OIItemInfo oiItemInfo = new OIItemInfo(-1, -1, -1, _import ? Studio.Studio.GetNewIndex() : -1);
                    oiItemInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiItemInfo);
                    break;

                case 2:
                    OILightInfo oiLightInfo = new OILightInfo(-1, _import ? Studio.Studio.GetNewIndex() : -1);
                    oiLightInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiLightInfo);
                    break;

                case 3:
                    OIFolderInfo oiFolderInfo = new OIFolderInfo(_import ? Studio.Studio.GetNewIndex() : -1);
                    oiFolderInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiFolderInfo);
                    break;

                case 4:
                    OIRouteInfo oiRouteInfo = new OIRouteInfo(_import ? Studio.Studio.GetNewIndex() : -1);
                    oiRouteInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiRouteInfo);
                    break;

                case 5:
                    OICameraInfo oiCameraInfo = new OICameraInfo(_import ? Studio.Studio.GetNewIndex() : -1);
                    oiCameraInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiCameraInfo);
                    break;

                default:
                    Debug.LogWarning((object)string.Format("おかしい情報が入っている : {0}", (object)num2));
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public static OCICharFemale Load(
            OICharInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode)
        {
            OCICharFemale ociCharFemale = AddObjectFemale.Add(Singleton <Character> .Instance.CreateChara((byte)1, Singleton <Scene> .Instance.commonSpace, -1, _info.charFile), _info, _parent, _parentNode, false, -1);

            foreach (KeyValuePair <int, List <ObjectInfo> > keyValuePair in _info.child)
            {
                KeyValuePair <int, List <ObjectInfo> > v = keyValuePair;
                AddObjectAssist.LoadChild(v.Value, (ObjectCtrlInfo)ociCharFemale, ociCharFemale.dicAccessoryPoint.First <KeyValuePair <TreeNodeObject, int> >((Func <KeyValuePair <TreeNodeObject, int>, bool>)(x => x.Value == v.Key)).Key);
            }
            return(ociCharFemale);
        }
Exemplo n.º 4
0
        public static void LoadChild(
            ObjectInfo _child,
            ObjectCtrlInfo _parent     = null,
            TreeNodeObject _parentNode = null)
        {
            switch (_child.kind)
            {
            case 0:
                OICharInfo _info = _child as OICharInfo;
                if (_info.sex == 1)
                {
                    AddObjectFemale.Load(_info, _parent, _parentNode);
                    break;
                }
                AddObjectMale.Load(_info, _parent, _parentNode);
                break;

            case 1:
                AddObjectItem.Load(_child as OIItemInfo, _parent, _parentNode);
                break;

            case 2:
                AddObjectLight.Load(_child as OILightInfo, _parent, _parentNode);
                break;

            case 3:
                AddObjectFolder.Load(_child as OIFolderInfo, _parent, _parentNode);
                break;

            case 4:
                AddObjectRoute.Load(_child as OIRouteInfo, _parent, _parentNode);
                break;

            case 5:
                AddObjectCamera.Load(_child as OICameraInfo, _parent, _parentNode);
                break;
            }
        }
Exemplo n.º 5
0
        private static OCICharFemale Add(
            ChaControl _female,
            OICharInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCICharFemale ociCharFemale = new OCICharFemale();
            ChaFileStatus _status       = new ChaFileStatus();

            _status.Copy(_female.fileStatus);
            _female.ChangeNowCoordinate(false, true);
            _female.Load(true);
            _female.InitializeExpression(1, true);
            ociCharFemale.charInfo         = _female;
            ociCharFemale.charReference    = (ChaReference)_female;
            ociCharFemale.preparation      = (Preparation)_female.objAnim.GetComponent <Preparation>();
            ociCharFemale.finalIK          = _female.fullBodyIK;
            ociCharFemale.charInfo.hideMoz = false;
            for (int index = 0; index < 2; ++index)
            {
                GameObject gameObject = _female.objHair.SafeGet <GameObject>(index);
                if (Object.op_Inequality((Object)gameObject, (Object)null))
                {
                    AddObjectAssist.ArrangeNames(gameObject.get_transform());
                }
            }
            AddObjectAssist.SetupAccessoryDynamicBones((OCIChar)ociCharFemale);
            AddObjectAssist.DisableComponent((OCIChar)ociCharFemale);
            ociCharFemale.objectInfo = (ObjectInfo)_info;
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(((Component)_female).get_transform(), _info.dicKey);

            guideObject.scaleSelect   = 0.1f;
            guideObject.scaleRot      = 0.05f;
            guideObject.isActiveFunc += new GuideObject.IsActiveFunc(((ObjectCtrlInfo)ociCharFemale).OnSelect);
            guideObject.SetVisibleCenter(true);
            ociCharFemale.guideObject               = guideObject;
            ociCharFemale.optionItemCtrl            = (OptionItemCtrl)((Component)_female).get_gameObject().AddComponent <OptionItemCtrl>();
            ociCharFemale.optionItemCtrl.animator   = _female.animBody;
            ociCharFemale.optionItemCtrl.oiCharInfo = _info;
            _info.changeAmount.onChangeScale       += new Action <Vector3>(ociCharFemale.optionItemCtrl.ChangeScale);
            ociCharFemale.charAnimeCtrl             = ociCharFemale.preparation?.CharAnimeCtrl;
            if (Object.op_Implicit((Object)ociCharFemale.charAnimeCtrl))
            {
                ociCharFemale.charAnimeCtrl.oiCharInfo = _info;
            }
            ociCharFemale.yureCtrl = ociCharFemale.preparation.YureCtrl;
            ociCharFemale.yureCtrl.Init((OCIChar)ociCharFemale);
            if (_info.animeInfo.group == 0 && _info.animeInfo.category == 2 && _info.animeInfo.no == 11)
            {
                int   group               = _info.animeInfo.group;
                int   category            = _info.animeInfo.category;
                int   no                  = _info.animeInfo.no;
                float animeNormalizedTime = _info.animeNormalizedTime;
                ociCharFemale.LoadAnime(0, 1, 0, 0.0f);
                _female.animBody.Update(0.0f);
                _info.animeInfo.group     = group;
                _info.animeInfo.category  = category;
                _info.animeInfo.no        = no;
                _info.animeNormalizedTime = animeNormalizedTime;
            }
            IKSolver ikSolver = ((IK)ociCharFemale.finalIK).GetIKSolver();

            if (!ikSolver.get_initiated())
            {
                ikSolver.Initiate(((Component)ociCharFemale.finalIK).get_transform());
            }
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)ociCharFemale);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)ociCharFemale);
            }
            TreeNodeObject _parent1       = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode(_info.charFile.parameter.fullname, _parent1);

            treeNodeObject.enableChangeParent      = true;
            treeNodeObject.treeState               = _info.treeState;
            treeNodeObject.onVisible              += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)ociCharFemale).OnVisible);
            treeNodeObject.enableVisible           = true;
            treeNodeObject.visible                 = _info.visible;
            guideObject.guideSelect.treeNodeObject = treeNodeObject;
            ociCharFemale.treeNodeObject           = treeNodeObject;
            _info.changeAmount.OnChange();
            AddObjectAssist.InitBone((OCIChar)ociCharFemale, _female.objBodyBone.get_transform(), Singleton <Info> .Instance.dicBoneInfo);
            AddObjectAssist.InitIKTarget((OCIChar)ociCharFemale, _addInfo);
            AddObjectAssist.InitLookAt((OCIChar)ociCharFemale);
            AddObjectAssist.InitAccessoryPoint((OCIChar)ociCharFemale);
            ociCharFemale.voiceCtrl.ociChar = (OCIChar)ociCharFemale;
            ociCharFemale.InitKinematic(((Component)_female).get_gameObject(), ociCharFemale.finalIK, _female.neckLookCtrl, (DynamicBone[])null, AddObjectFemale.GetSkirtDynamic(_female.objClothes));
            treeNodeObject.enableAddChild = false;
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)ociCharFemale);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)ociCharFemale);
            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            ociCharFemale.LoadAnime(_info.animeInfo.group, _info.animeInfo.category, _info.animeInfo.no, _info.animeNormalizedTime);
            for (int index = 0; index < 5; ++index)
            {
                ociCharFemale.ActiveIK((OIBoneInfo.BoneGroup)(1 << index), _info.activeIK[index], false);
            }
            ociCharFemale.ActiveKinematicMode(OICharInfo.KinematicMode.IK, _info.enableIK, true);
            // ISSUE: object of a compiler-generated type is created
            foreach (\u003C\u003E__AnonType18 <OIBoneInfo.BoneGroup, int> anonType18 in ((IEnumerable <OIBoneInfo.BoneGroup>)FKCtrl.parts).Select <OIBoneInfo.BoneGroup, \u003C\u003E__AnonType18 <OIBoneInfo.BoneGroup, int> >((Func <OIBoneInfo.BoneGroup, int, \u003C\u003E__AnonType18 <OIBoneInfo.BoneGroup, int> >)((p, i) => new \u003C\u003E__AnonType18 <OIBoneInfo.BoneGroup, int>(p, i))))
            {
                ociCharFemale.ActiveFK(anonType18.p, ociCharFemale.oiCharInfo.activeFK[anonType18.i], false);
            }
            ociCharFemale.ActiveKinematicMode(OICharInfo.KinematicMode.FK, _info.enableFK, true);
            for (int categoryNo = 0; categoryNo < _info.expression.Length; ++categoryNo)
            {
                ociCharFemale.charInfo.EnableExpressionCategory(categoryNo, _info.expression[categoryNo]);
            }
            ociCharFemale.animeSpeed        = ociCharFemale.animeSpeed;
            ociCharFemale.animeOptionParam1 = ociCharFemale.animeOptionParam1;
            ociCharFemale.animeOptionParam2 = ociCharFemale.animeOptionParam2;
            foreach (byte num in _female.fileStatus.siruLv)
            {
                num = (byte)0;
            }
            _status.visibleSonAlways = _info.visibleSon;
            ociCharFemale.SetSonLength(_info.sonLength);
            ociCharFemale.SetVisibleSimple(_info.visibleSimple);
            ociCharFemale.SetSimpleColor(_info.simpleColor);
            AddObjectAssist.UpdateState((OCIChar)ociCharFemale, _status);
            return(ociCharFemale);
        }
Exemplo n.º 6
0
        public void InitBones(OICharInfo _info, ChaReference _charReference)
        {
            if (_info == null)
            {
                return;
            }
            this.listBones.Clear();
            Dictionary <int, FKCtrl.TargetInfo> dictionary = new Dictionary <int, FKCtrl.TargetInfo>();

            foreach (KeyValuePair <int, Info.BoneInfo> keyValuePair in Singleton <Info> .Instance.dicBoneInfo)
            {
                GameObject loop;
                switch (keyValuePair.Value.group)
                {
                case 7:
                case 8:
                case 9:
                    loop = _charReference.GetReferenceInfo(ChaReference.RefObjKey.HeadParent).get_transform().FindLoop(keyValuePair.Value.bone);
                    break;

                default:
                    loop = this.transform.FindLoop(keyValuePair.Value.bone);
                    if (Object.op_Equality((Object)loop, (Object)null))
                    {
                        Debug.LogWarning((object)keyValuePair.Value.bone);
                        break;
                    }
                    break;
                }
                if (!Object.op_Equality((Object)loop, (Object)null))
                {
                    FKCtrl.TargetInfo targetInfo1 = (FKCtrl.TargetInfo)null;
                    if (dictionary.TryGetValue(keyValuePair.Value.sync, out targetInfo1))
                    {
                        targetInfo1.AddSyncBone(loop);
                    }
                    else
                    {
                        OIBoneInfo oiBoneInfo = (OIBoneInfo)null;
                        if (_info.bones.TryGetValue(keyValuePair.Key, out oiBoneInfo))
                        {
                            OIBoneInfo.BoneGroup _group;
                            switch (keyValuePair.Value.group)
                            {
                            case 0:
                            case 1:
                            case 2:
                            case 3:
                            case 4:
                                _group = OIBoneInfo.BoneGroup.Body;
                                break;

                            case 7:
                            case 8:
                            case 9:
                                _group = OIBoneInfo.BoneGroup.Hair;
                                break;

                            case 10:
                                _group = OIBoneInfo.BoneGroup.Neck;
                                break;

                            case 11:
                            case 12:
                                _group = OIBoneInfo.BoneGroup.Breast;
                                break;

                            case 13:
                                _group = OIBoneInfo.BoneGroup.Skirt;
                                break;

                            default:
                                _group = (OIBoneInfo.BoneGroup)(1 << keyValuePair.Value.group);
                                break;
                            }
                            FKCtrl.TargetInfo targetInfo2 = new FKCtrl.TargetInfo(loop, oiBoneInfo.changeAmount, _group, keyValuePair.Value.level);
                            this.listBones.Add(targetInfo2);
                            if (keyValuePair.Value.sync != -1)
                            {
                                dictionary.Add(keyValuePair.Key, targetInfo2);
                            }
                        }
                    }
                }
            }
            this.count = this.listBones.Count;
        }