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); }
private void Awake() { base.Start(); this.treeNodeObject = (TreeNodeObject)null; }
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); }