Exemple #1
0
        private void Update()
        {
            if (!Singleton <Studio.Studio> .IsInstance() || Singleton <Studio.Studio> .Instance.isInputNow || (!Singleton <Scene> .IsInstance() || Singleton <Scene> .Instance.AddSceneName != string.Empty))
            {
                return;
            }
            bool flag1 = Input.GetKey((KeyCode)306) | Input.GetKey((KeyCode)305);

            if ((Input.GetKey((KeyCode)304) | Input.GetKey((KeyCode)303)) & Input.GetKeyDown((KeyCode)122))
            {
                if (!Singleton <UndoRedoManager> .Instance.CanRedo)
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Redo();
            }
            else if (Input.GetKeyDown((KeyCode)122))
            {
                if (!Singleton <UndoRedoManager> .Instance.CanUndo)
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Undo();
            }
            else if (Input.GetKeyDown((KeyCode)102))
            {
                TreeNodeObject selectNode = this.treeNodeCtrl.selectNode;
                if (Object.op_Equality((Object)selectNode, (Object)null))
                {
                    return;
                }
                ObjectCtrlInfo objectCtrlInfo = (ObjectCtrlInfo)null;
                if (!Singleton <Studio.Studio> .Instance.dicInfo.TryGetValue(selectNode, out objectCtrlInfo))
                {
                    return;
                }
                this.cameraControl.targetPos = ((Component)objectCtrlInfo.guideObject).get_transform().get_position();
            }
            else if (Input.GetKeyDown((KeyCode)99))
            {
                GuideObject[] selectObjects = Singleton <GuideObjectManager> .Instance.selectObjects;
                if (((IList <GuideObject>)selectObjects).IsNullOrEmpty <GuideObject>())
                {
                    return;
                }
                List <GuideCommand.EqualsInfo> self = new List <GuideCommand.EqualsInfo>();
                foreach (GuideObject guideObject in selectObjects)
                {
                    if (guideObject.enablePos)
                    {
                        self.Add(guideObject.SetWorldPos(this.cameraControl.targetPos));
                    }
                }
                if (self.IsNullOrEmpty <GuideCommand.EqualsInfo>())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Push((ICommand) new GuideCommand.MoveEqualsCommand(self.ToArray()));
            }
            else if (flag1 && Input.GetKeyDown((KeyCode)115))
            {
                this.systemButtonCtrl.OnClickSave();
            }
            else if (flag1 && Input.GetKeyDown((KeyCode)100))
            {
                Singleton <Studio.Studio> .Instance.Duplicate();
            }
            else if (Input.GetKeyDown((KeyCode)(int)sbyte.MaxValue))
            {
                this.workspaceCtrl.OnClickDelete();
            }
            else if (Input.GetKeyDown((KeyCode)119))
            {
                Singleton <GuideObjectManager> .Instance.mode = 0;
            }
            else if (Input.GetKeyDown((KeyCode)101))
            {
                Singleton <GuideObjectManager> .Instance.mode = 1;
            }
            else if (Input.GetKeyDown((KeyCode)114))
            {
                Singleton <GuideObjectManager> .Instance.mode = 2;
            }
            else if (Input.GetKeyDown((KeyCode)113))
            {
                this.studioScene.OnClickAxis();
            }
            else if (Input.GetKeyDown((KeyCode)106))
            {
                this.studioScene.OnClickAxisTrans();
            }
            else if (Input.GetKeyDown((KeyCode)107))
            {
                this.studioScene.OnClickAxisCenter();
            }
            else if (Input.GetKeyDown((KeyCode)292))
            {
                this.gameScreenShot.Capture(string.Empty);
            }
            else if (Input.GetKeyDown((KeyCode)283))
            {
                if (Singleton <GameCursor> .IsInstance())
                {
                    Singleton <GameCursor> .Instance.SetCursorLock(false);
                }
                Singleton <Scene> .Instance.LoadReserve(new Scene.Data()
                {
                    levelName = "StudioShortcutMenu",
                    isAdd     = true
                }, false);
            }
            else if (Input.GetKeyDown((KeyCode)27))
            {
                if (Singleton <GameCursor> .IsInstance())
                {
                    Singleton <GameCursor> .Instance.SetCursorLock(false);
                }
                Singleton <Scene> .Instance.GameEnd(true);
            }
            else
            {
                bool flag2 = false;
                for (int _no = 0; _no < 10; ++_no)
                {
                    if (Input.GetKeyDown((KeyCode)(int)this.cameraKey[_no]))
                    {
                        this.studioScene.OnClickLoadCamera(_no);
                        flag2 = true;
                        break;
                    }
                }
                if (flag2 || !Input.GetKeyDown((KeyCode)104))
                {
                    return;
                }
                Singleton <Studio.Studio> .Instance.cameraSelector.NextCamera();
            }
        }
        public static OCILight Load(
            OILightInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCILight ociLight = new OCILight();

            Info.LightLoadInfo lightLoadInfo = (Info.LightLoadInfo)null;
            if (!Singleton <Info> .Instance.dicLightLoadInfo.TryGetValue(_info.no, out lightLoadInfo))
            {
                Debug.LogError((object)string.Format("存在しない番号[{0}]", (object)_info.no));
                return((OCILight)null);
            }
            ociLight.objectInfo = (ObjectInfo)_info;
            GameObject gameObject = Utility.LoadAsset <GameObject>(lightLoadInfo.bundlePath, lightLoadInfo.fileName, lightLoadInfo.manifest);

            gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform());
            ociLight.objectLight = gameObject;
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey);

            guideObject.scaleSelect = 0.1f;
            guideObject.scaleRot    = 0.05f;
            guideObject.isActive    = false;
            guideObject.enableScale = false;
            guideObject.SetVisibleCenter(true);
            ociLight.guideObject = guideObject;
            ociLight.lightColor  = (LightColor)gameObject.GetComponent <LightColor>();
            if (Object.op_Implicit((Object)ociLight.lightColor))
            {
                ociLight.lightColor.color = _info.color;
            }
            ociLight.lightTarget = lightLoadInfo.target;
            switch (lightLoadInfo.target)
            {
            case Info.LightLoadInfo.Target.Chara:
                int num1 = ociLight.light.get_cullingMask() ^ LayerMask.GetMask(new string[2]
                {
                    "Map",
                    "MapNoShadow"
                });
                ociLight.light.set_cullingMask(num1);
                break;

            case Info.LightLoadInfo.Target.Map:
                int num2 = ociLight.light.get_cullingMask() ^ LayerMask.GetMask(new string[1]
                {
                    "Chara"
                });
                ociLight.light.set_cullingMask(num2);
                break;
            }
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)ociLight);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)ociLight);
            }
            TreeNodeObject _parent1       = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode(lightLoadInfo.name, _parent1);

            treeNodeObject.enableAddChild          = false;
            treeNodeObject.treeState               = _info.treeState;
            guideObject.guideSelect.treeNodeObject = treeNodeObject;
            ociLight.treeNodeObject = treeNodeObject;
            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            _info.changeAmount.OnChange();
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)ociLight);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)ociLight);
            ociLight.Update();
            return(ociLight);
        }
 public override void OnLoadAttach(TreeNodeObject _parent, ObjectCtrlInfo _child)
 {
 }
 public override void OnDetachChild(ObjectCtrlInfo _child)
 {
 }
 public abstract void OnDetachChild(ObjectCtrlInfo _child);
 public abstract void OnLoadAttach(TreeNodeObject _parent, ObjectCtrlInfo _child);
Exemple #7
0
        public static OCIRoute Load(
            OIRouteInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCIRoute _ocir = new OCIRoute();

            _ocir.objectInfo = (ObjectInfo)_info;
            GameObject gameObject = CommonLib.LoadAsset <GameObject>("studio/base/00.unity3d", "p_Route", true, string.Empty);

            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                Studio.Studio.DeleteIndex(_info.dicKey);
                return((OCIRoute)null);
            }
            gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform());
            _ocir.objectItem = gameObject;
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey);

            guideObject.isActive    = false;
            guideObject.scaleSelect = 0.1f;
            guideObject.scaleRot    = 0.05f;
            guideObject.enableScale = false;
            guideObject.SetVisibleCenter(true);
            _ocir.guideObject = guideObject;
            _ocir.childRoot   = gameObject.get_transform().GetChild(0);
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)_ocir);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)_ocir);
            }
            TreeNodeObject _parent1 = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject _parent2 = Studio.Studio.AddNode(_info.name, _parent1);

            _parent2.treeState                     = _info.treeState;
            _parent2.enableVisible                 = true;
            _parent2.enableChangeParent            = false;
            _parent2.visible                       = _info.visible;
            _parent2.colorSelect                   = _parent2.baseColor;
            _parent2.onVisible                    += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)_ocir).OnVisible);
            _parent2.onDelete                     += new Action(_ocir.OnDeleteNode);
            _parent2.checkChild                   += new TreeNodeObject.CheckFunc(_ocir.CheckParentLoop);
            _parent2.checkParent                  += new TreeNodeObject.CheckFunc(_ocir.CheckParentLoop);
            guideObject.guideSelect.treeNodeObject = _parent2;
            _ocir.treeNodeObject                   = _parent2;
            _ocir.routeComponent                   = (RouteComponent)gameObject.GetComponent <RouteComponent>();
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode("子接続先", _parent2);

            treeNodeObject.enableChangeParent = false;
            treeNodeObject.enableDelete       = false;
            treeNodeObject.enableCopy         = false;
            treeNodeObject.baseColor          = Utility.ConvertColor(204, 128, 164);
            treeNodeObject.colorSelect        = treeNodeObject.baseColor;
            _parent2.childRoot  = treeNodeObject;
            _ocir.childNodeRoot = treeNodeObject;
            if (_info.route.IsNullOrEmpty <OIRoutePointInfo>())
            {
                _ocir.routeInfo.route.Add(new OIRoutePointInfo(Studio.Studio.GetNewIndex()));
            }
            foreach (OIRoutePointInfo _rpInfo in _info.route)
            {
                AddObjectRoute.LoadPoint(_ocir, _rpInfo, -1);
            }
            Singleton <Studio.Studio> .Instance.treeNodeCtrl.RefreshHierachy();

            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            _info.changeAmount.OnChange();
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)_ocir);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)_ocir);
            _info.changeAmount.onChangePos += new Action(_ocir.UpdateLine);
            _info.changeAmount.onChangeRot += new Action(_ocir.UpdateLine);
            _ocir.ForceUpdateLine();
            _ocir.visibleLine = _ocir.visibleLine;
            if (_ocir.isPlay)
            {
                _ocir.Play();
            }
            else
            {
                _ocir.Stop(true);
            }
            return(_ocir);
        }
Exemple #8
0
 public DuplicateParentInfo(ObjectCtrlInfo _info, TreeNodeObject _node)
 {
     this.info = _info;
     this.node = _node;
 }
Exemple #9
0
        public static OCICamera Load(
            OICameraInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCICamera ocic = new OCICamera();

            ocic.objectInfo = (ObjectInfo)_info;
            GameObject gameObject = CommonLib.LoadAsset <GameObject>("studio/base/00.unity3d", "p_koi_stu_cameraicon00_00", true, string.Empty);

            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                Studio.Studio.DeleteIndex(_info.dicKey);
                return((OCICamera)null);
            }
            gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform());
            ocic.objectItem   = gameObject;
            ocic.meshRenderer = (MeshRenderer)gameObject.GetComponent <MeshRenderer>();
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey);

            guideObject.isActive    = false;
            guideObject.scaleSelect = 0.1f;
            guideObject.scaleRot    = 0.05f;
            guideObject.enableScale = false;
            ocic.guideObject        = guideObject;
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)ocic);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)ocic);
            }
            TreeNodeObject _parent1       = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode(_info.name, _parent1);

            treeNodeObject.onVisible              += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)ocic).OnVisible);
            treeNodeObject.treeState               = _info.treeState;
            treeNodeObject.enableVisible           = true;
            treeNodeObject.enableAddChild          = false;
            treeNodeObject.visible                 = _info.visible;
            treeNodeObject.baseColor               = !_info.active ? AddObjectCamera.baseColor : AddObjectCamera.activeColor;
            treeNodeObject.colorSelect             = treeNodeObject.baseColor;
            guideObject.guideSelect.treeNodeObject = treeNodeObject;
            ocic.treeNodeObject = treeNodeObject;
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerClickAsObservable((UIBehaviour)treeNodeObject.buttonSelect), (Action <M0>)(_ped =>
            {
                if (_ped.get_button() != 1)
                {
                    return;
                }
                Singleton <Studio.Studio> .Instance.ChangeCamera(ocic);
                Singleton <Studio.Studio> .Instance.manipulatePanelCtrl.UpdateInfo(5);
            }));
            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            _info.changeAmount.OnChange();
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)ocic);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)ocic);
            Singleton <Studio.Studio> .Instance.ChangeCamera(ocic, _info.active, false);

            return(ocic);
        }
        public static OCIItem Load(
            OIItemInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCIItem _ociItem = new OCIItem();

            Info.ItemLoadInfo loadInfo = AddObjectItem.GetLoadInfo(_info.group, _info.category, _info.no);
            if (loadInfo == null)
            {
                Debug.LogWarningFormat("存在しない : G[{0}] : C[{1}] : N[{2}]", new object[3]
                {
                    (object)_info.group,
                    (object)_info.category,
                    (object)_info.no
                });
                loadInfo = AddObjectItem.GetLoadInfo(0, 0, 399);
            }
            _ociItem.objectInfo = (ObjectInfo)_info;
            GameObject gameObject = CommonLib.LoadAsset <GameObject>(loadInfo.bundlePath, loadInfo.fileName, true, loadInfo.manifest);

            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                Debug.LogError((object)string.Format("読み込み失敗 : {0} : {1} : {2}", (object)loadInfo.manifest, (object)loadInfo.bundlePath, (object)loadInfo.fileName));
                Studio.Studio.DeleteIndex(_info.dicKey);
                return((OCIItem)null);
            }
            gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform());
            _ociItem.objectItem    = gameObject;
            _ociItem.itemComponent = (ItemComponent)gameObject.GetComponent <ItemComponent>();
            _ociItem.arrayRender   = ((IEnumerable <Renderer>)gameObject.GetComponentsInChildren <Renderer>()).Where <Renderer>((Func <Renderer, bool>)(v => v.get_enabled())).ToArray <Renderer>();
            ParticleSystem[] componentsInChildren = (ParticleSystem[])gameObject.GetComponentsInChildren <ParticleSystem>();
            if (!((IList <ParticleSystem>)componentsInChildren).IsNullOrEmpty <ParticleSystem>())
            {
                _ociItem.arrayParticle = ((IEnumerable <ParticleSystem>)componentsInChildren).Where <ParticleSystem>((Func <ParticleSystem, bool>)(v => v.get_isPlaying())).ToArray <ParticleSystem>();
            }
            MeshCollider component = (MeshCollider)gameObject.GetComponent <MeshCollider>();

            if (Object.op_Implicit((Object)component))
            {
                ((Collider)component).set_enabled(false);
            }
            _ociItem.dynamicBones = (DynamicBone[])gameObject.GetComponentsInChildren <DynamicBone>();
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey);

            guideObject.isActive      = false;
            guideObject.scaleSelect   = 0.1f;
            guideObject.scaleRot      = 0.05f;
            guideObject.isActiveFunc += new GuideObject.IsActiveFunc(((ObjectCtrlInfo)_ociItem).OnSelect);
            guideObject.enableScale   = !Object.op_Inequality((Object)_ociItem.itemComponent, (Object)null) || _ociItem.itemComponent.isScale;
            guideObject.SetVisibleCenter(true);
            _ociItem.guideObject = guideObject;
            if (Object.op_Inequality((Object)_ociItem.itemComponent, (Object)null) && Object.op_Inequality((Object)_ociItem.itemComponent.childRoot, (Object)null))
            {
                _ociItem.childRoot = _ociItem.itemComponent.childRoot;
            }
            if (Object.op_Equality((Object)_ociItem.childRoot, (Object)null))
            {
                _ociItem.childRoot = gameObject.get_transform();
            }
            _ociItem.animator = (Animator)gameObject.GetComponentInChildren <Animator>();
            if (Object.op_Implicit((Object)_ociItem.animator))
            {
                ((Behaviour)_ociItem.animator).set_enabled(Object.op_Inequality((Object)_ociItem.itemComponent, (Object)null) && _ociItem.itemComponent.isAnime);
            }
            if (Object.op_Inequality((Object)_ociItem.itemComponent, (Object)null))
            {
                _ociItem.itemComponent.SetGlass();
                _ociItem.itemComponent.SetEmission();
                if (_addInfo && _ociItem.itemComponent.check)
                {
                    Color[] defColorMain = _ociItem.itemComponent.defColorMain;
                    for (int index = 0; index < 3; ++index)
                    {
                        _info.colors[index].mainColor = defColorMain[index];
                    }
                    Color[] defColorPattern = _ociItem.itemComponent.defColorPattern;
                    for (int index = 0; index < 3; ++index)
                    {
                        _info.colors[index].pattern.color = defColorPattern[index];
                        _info.colors[index].metallic      = _ociItem.itemComponent.info[index].defMetallic;
                        _info.colors[index].glossiness    = _ociItem.itemComponent.info[index].defGlossiness;
                        _info.colors[index].pattern.clamp = _ociItem.itemComponent.info[index].defClamp;
                        _info.colors[index].pattern.uv    = _ociItem.itemComponent.info[index].defUV;
                        _info.colors[index].pattern.rot   = _ociItem.itemComponent.info[index].defRot;
                    }
                    _info.colors[3].mainColor = _ociItem.itemComponent.defGlass;
                    _info.emissionColor       = _ociItem.itemComponent.DefEmissionColor;
                    _info.emissionPower       = _ociItem.itemComponent.defEmissionStrength;
                    _info.lightCancel         = _ociItem.itemComponent.defLightCancel;
                }
                _ociItem.itemComponent.SetupSea();
            }
            _ociItem.particleComponent = (ParticleComponent)gameObject.GetComponent <ParticleComponent>();
            if (Object.op_Inequality((Object)_ociItem.particleComponent, (Object)null) && _addInfo)
            {
                _info.colors[0].mainColor = _ociItem.particleComponent.defColor01;
            }
            _ociItem.iconComponent = (IconComponent)gameObject.GetComponent <IconComponent>();
            if (Object.op_Inequality((Object)_ociItem.iconComponent, (Object)null))
            {
                _ociItem.iconComponent.Layer = LayerMask.NameToLayer("Studio/Camera");
            }
            _ociItem.VisibleIcon    = Singleton <Studio.Studio> .Instance.workInfo.visibleGimmick;
            _ociItem.panelComponent = (PanelComponent)gameObject.GetComponent <PanelComponent>();
            if (_addInfo && Object.op_Inequality((Object)_ociItem.panelComponent, (Object)null))
            {
                _info.colors[0].mainColor     = _ociItem.panelComponent.defColor;
                _info.colors[0].pattern.uv    = _ociItem.panelComponent.defUV;
                _info.colors[0].pattern.clamp = _ociItem.panelComponent.defClamp;
                _info.colors[0].pattern.rot   = _ociItem.panelComponent.defRot;
            }
            _ociItem.seComponent = (SEComponent)gameObject.GetComponent <SEComponent>();
            if (_addInfo && Object.op_Inequality((Object)_ociItem.itemComponent, (Object)null) && !((IList <ItemComponent.OptionInfo>)_ociItem.itemComponent.optionInfos).IsNullOrEmpty <ItemComponent.OptionInfo>())
            {
                _info.option = Enumerable.Repeat <bool>(true, _ociItem.itemComponent.optionInfos.Length).ToList <bool>();
            }
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)_ociItem);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)_ociItem);
            }
            TreeNodeObject _parent1       = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode(loadInfo.name, _parent1);

            treeNodeObject.treeState               = _info.treeState;
            treeNodeObject.onVisible              += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)_ociItem).OnVisible);
            treeNodeObject.enableVisible           = true;
            treeNodeObject.visible                 = _info.visible;
            guideObject.guideSelect.treeNodeObject = treeNodeObject;
            _ociItem.treeNodeObject                = treeNodeObject;
            if (!loadInfo.bones.IsNullOrEmpty <string>())
            {
                _ociItem.itemFKCtrl = (ItemFKCtrl)gameObject.AddComponent <ItemFKCtrl>();
                _ociItem.itemFKCtrl.InitBone(_ociItem, loadInfo, _addInfo);
            }
            else
            {
                _ociItem.itemFKCtrl = (ItemFKCtrl)null;
            }
            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            _info.changeAmount.OnChange();
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)_ociItem);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)_ociItem);
            if (Object.op_Implicit((Object)_ociItem.animator))
            {
                if (_info.animePattern != 0)
                {
                    _ociItem.SetAnimePattern(_info.animePattern);
                }
                _ociItem.animator.set_speed(_info.animeSpeed);
                if ((double)_info.animeNormalizedTime != 0.0 && _ociItem.animator.get_layerCount() != 0)
                {
                    _ociItem.animator.Update(1f);
                    AnimatorStateInfo animatorStateInfo = _ociItem.animator.GetCurrentAnimatorStateInfo(0);
                    _ociItem.animator.Play(((AnimatorStateInfo) ref animatorStateInfo).get_shortNameHash(), 0, _info.animeNormalizedTime);
                }
            }
            _ociItem.SetupPatternTex();
            _ociItem.SetMainTex();
            _ociItem.UpdateColor();
            _ociItem.ActiveFK(_ociItem.itemInfo.enableFK);
            _ociItem.UpdateFKColor();
            _ociItem.ActiveDynamicBone(_ociItem.itemInfo.enableDynamicBone);
            _ociItem.UpdateOption();
            _ociItem.particleComponent?.PlayOnLoad();
            return(_ociItem);
        }
        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);
        }