Example #1
0
        public void ChangeAnimator(string assetbundle, string asset)
        {
            RuntimeAnimatorController rac = AssetUtility.LoadAsset <RuntimeAnimatorController>(assetbundle, asset, string.Empty);

            if (!Object.op_Inequality((Object)rac, (Object)null))
            {
                return;
            }
            this.Animation.SetAnimatorController(rac);
        }
Example #2
0
        public void InitializeFaceLight(GameObject root)
        {
            if (Object.op_Inequality((Object)this.FaceLight, (Object)null))
            {
                Object.Destroy((Object)((Component)this.FaceLight).get_gameObject());
            }
            if (!Singleton <Resources> .IsInstance() || Object.op_Equality((Object)root, (Object)null))
            {
                return;
            }
            LocomotionProfile locomotionProfile   = Singleton <Resources> .Instance.LocomotionProfile;
            string            fadeLightParentName = locomotionProfile.FadeLightParentName;

            if (fadeLightParentName.IsNullOrEmpty())
            {
                return;
            }
            GameObject loop = root.get_transform().FindLoop(fadeLightParentName);

            if (Object.op_Equality((Object)loop, (Object)null))
            {
                return;
            }
            DefinePack definePack  = Singleton <Resources> .Instance.DefinePack;
            GameObject gameObject1 = AssetUtility.LoadAsset <GameObject>(definePack.ABPaths.ActorPrefab, "FaceLight", definePack.ABManifests.Default);

            if (Object.op_Equality((Object)gameObject1, (Object)null))
            {
                return;
            }
            GameObject gameObject2 = (GameObject)Object.Instantiate <GameObject>((M0)gameObject1, loop.get_transform(), false);

            if (Object.op_Equality((Object)gameObject2, (Object)null))
            {
                return;
            }
            this.FaceLight = (Light)gameObject2.GetComponent <Light>();
            if (Object.op_Equality((Object)this.FaceLight, (Object)null))
            {
                Object.Destroy((Object)gameObject2);
            }
            else
            {
                ((Component)this.FaceLight).get_transform().set_localRotation(Quaternion.get_identity());
                ((Component)this.FaceLight).get_transform().set_localPosition(locomotionProfile.FaceLightOffset);
                if (!((Behaviour)this.FaceLight).get_enabled())
                {
                    return;
                }
                ((Behaviour)this.FaceLight).set_enabled(false);
            }
        }
        public virtual void OnStart()
        {
            AgentActor agent = this.Agent;

            agent.EventKey = EventType.Masturbation;
            ((Task)this).OnStart();
            agent.CurrentPoint = this.Agent.TargetInSightActionPoint;
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            agent.ElectNextPoint();
            if (Object.op_Equality((Object)agent.CurrentPoint, (Object)null))
            {
                return;
            }
            agent.CurrentPoint.SetActiveMapItemObjs(false);
            ActionPointInfo actionPointInfo1 = agent.TargetInSightActionPoint.GetActionPointInfo(agent);

            agent.Animation.ActionPointInfo = actionPointInfo1;
            ActionPointInfo actionPointInfo2 = actionPointInfo1;
            Transform       t    = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.baseNullName)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject      loop = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.recoveryNullName);

            agent.Animation.RecoveryPoint = loop?.get_transform();
            int eventId = actionPointInfo2.eventID;

            agent.ActionID = eventId;
            int actionID = eventId;
            int poseId   = actionPointInfo2.poseID;

            agent.PoseID = poseId;
            int       poseID    = poseId;
            PlayState playState = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionID][poseID];

            agent.LoadActionFlag(actionID, poseID);
            agent.DeactivateNavMeshAgent();
            agent.Animation.StopAllAnimCoroutine();
            HScene.AnimationListInfo info = Singleton <Resources> .Instance.HSceneTable.lstAnimInfo[3][actionPointInfo2.poseID];
            agent.Animation.BeginIgnoreEvent();
            AssetBundleInfo           assetBundleInfo = playState.MainStateInfo.AssetBundleInfo;
            RuntimeAnimatorController rac             = AssetUtility.LoadAsset <RuntimeAnimatorController>((string)assetBundleInfo.assetbundle, (string)assetBundleInfo.asset, string.Empty);

            agent.Animation.SetAnimatorController(rac);
            agent.StartMasturbationSequence(info);
            agent.CurrentPoint.SetSlot((Actor)agent);
            agent.SetStand(t, false, 0.0f, 0);
            agent.SurprisePoseID   = new PoseKeyPair?(Singleton <Resources> .Instance.AgentProfile.PoseIDTable.SurpriseMasturbationID);
            agent.UpdateMotivation = true;
        }
Example #4
0
        public GameObject LoadEventItem(
            int itemID,
            string parentName,
            bool isSync,
            ActionItemInfo eventItemInfo)
        {
            GameObject gameObject = (GameObject)null;

            if (Object.op_Inequality((Object)this.CurrentPoint, (Object)null))
            {
                gameObject = this.CurrentPoint.CreateEventItems(itemID, parentName, isSync);
            }
            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                gameObject = CommonLib.LoadAsset <GameObject>((string)eventItemInfo.assetbundleInfo.assetbundle, (string)eventItemInfo.assetbundleInfo.asset, false, (string)eventItemInfo.assetbundleInfo.manifest);
                if (!MapScene.AssetBundlePaths.Exists((Predicate <ValueTuple <string, string> >)(x => (string)x.Item1 == (string)eventItemInfo.assetbundleInfo.assetbundle && (string)x.Item2 == (string)eventItemInfo.assetbundleInfo.manifest)))
                {
                    MapScene.AssetBundlePaths.Add(new ValueTuple <string, string>((string)eventItemInfo.assetbundleInfo.assetbundle, (string)eventItemInfo.assetbundleInfo.manifest));
                }
            }
            if (Object.op_Inequality((Object)gameObject, (Object)null))
            {
                GameObject loop = ((Component)this.ChaControl.animBody).get_transform().FindLoop(parentName);
                GameObject self = (GameObject)Object.Instantiate <GameObject>((M0)gameObject, loop.get_transform(), false);
                self.SetActiveIfDifferent(true);
                ((Object)self.get_gameObject()).set_name(((Object)gameObject.get_gameObject()).get_name());
                self.get_transform().set_localPosition(Vector3.get_zero());
                self.get_transform().set_localRotation(Quaternion.get_identity());
                self.get_transform().set_localScale(Vector3.get_one());
                this.Animation.Items.Add(new ValueTuple <int, GameObject>(itemID, self));
                Renderer[] componentsInChildren = (Renderer[])self.GetComponentsInChildren <Renderer>();
                foreach (Renderer renderer in componentsInChildren)
                {
                    renderer.set_enabled(false);
                }
                this.Animation.ItemRenderers.Add(new ValueTuple <int, Renderer[]>(itemID, componentsInChildren));
                if (eventItemInfo.existsAnimation)
                {
                    Animator component = (Animator)self.GetComponent <Animator>();
                    RuntimeAnimatorController animatorController = AssetUtility.LoadAsset <RuntimeAnimatorController>(eventItemInfo.animeAssetBundle);
                    component.set_runtimeAnimatorController(animatorController);
                    this.Animation.ItemAnimatorTable[((Object)self).GetInstanceID()] = new ItemAnimInfo()
                    {
                        Animator   = component,
                        Parameters = component.get_parameters(),
                        Sync       = isSync
                    };
                }
                Resources.TriValues triValues;
                if (Singleton <Resources> .Instance.Animation.ItemScaleTable.TryGetValue(itemID, out triValues))
                {
                    this._scaleCtrlInfos.Add(new Actor.ItemScaleInfo()
                    {
                        TargetItem = self,
                        ScaleMode  = triValues.ScaleType,
                        SThreshold = triValues.SThreshold,
                        MThreshold = triValues.MThreshold,
                        LThreshold = triValues.LThreshold
                    });
                }
                return(self);
            }
            AssetBundleInfo assetbundleInfo = eventItemInfo.assetbundleInfo;

            Debug.LogError((object)string.Format("イベントアイテム読み込み失敗: バンドルパス[{0}] プレハブ[{1}] マニフェスト[{2}]", (object)assetbundleInfo.assetbundle, (object)assetbundleInfo.asset, (object)assetbundleInfo.manifest));
            return((GameObject)null);
        }
Example #5
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            this._isReleased = true;
            AgentActor agent = this.Agent;

            agent.EventKey     = EventType.Lesbian;
            agent.CurrentPoint = agent.TargetInSightActionPoint;
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            Actor partner = agent.Partner;

            if (Object.op_Equality((Object)partner, (Object)null))
            {
                return;
            }
            agent.DeactivateNavMeshAgent();
            agent.IsKinematic = true;
            partner.SetActiveOnEquipedItem(false);
            partner.ChaControl.setAllLayerWeight(0.0f);
            partner.DeactivateNavMeshAgent();
            partner.IsKinematic = true;
            DateActionPointInfo dateActionPointInfo1 = agent.TargetInSightActionPoint.GetDateActionPointInfo(agent);

            agent.Animation.DateActionPointInfo = dateActionPointInfo1;
            DateActionPointInfo dateActionPointInfo2 = dateActionPointInfo1;
            Transform           basePointA           = ((Component)agent.CurrentPoint).get_transform().FindLoop(dateActionPointInfo2.baseNullNameA)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject          loop1 = ((Component)agent.CurrentPoint).get_transform().FindLoop(dateActionPointInfo2.recoveryNullNameA);

            agent.Animation.RecoveryPoint = loop1?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            Transform  basePointB = ((Component)agent.CurrentPoint).get_transform().FindLoop(dateActionPointInfo2.baseNullNameB)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject loop2      = ((Component)agent.CurrentPoint).get_transform().FindLoop(dateActionPointInfo2.recoveryNullNameB);

            partner.Animation.RecoveryPoint = loop2?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            int eventId = dateActionPointInfo2.eventID;

            agent.ActionID = eventId;
            int actionID = eventId;
            int poseIda  = dateActionPointInfo2.poseIDA;

            agent.PoseID = poseIda;
            int poseID1 = poseIda;
            int poseIdb = dateActionPointInfo2.poseIDB;

            partner.PoseID = poseIdb;
            int       poseID2    = poseIdb;
            PlayState playState1 = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionID][poseID1];

            agent.LoadActionFlag(actionID, poseID1);
            if (partner is AgentActor)
            {
                (partner as AgentActor).LoadActionFlag(actionID, poseID2);
            }
            PlayState playState2 = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionID][poseID2];

            HScene.AnimationListInfo info = Singleton <Resources> .Instance.HSceneTable.lstAnimInfo[4][dateActionPointInfo2.poseIDA];
            agent.Animation.BeginIgnoreEvent();
            partner.Animation.BeginIgnoreEvent();
            AssetBundleInfo           assetBundleInfo1 = playState1.MainStateInfo.AssetBundleInfo;
            RuntimeAnimatorController rac1             = AssetUtility.LoadAsset <RuntimeAnimatorController>((string)assetBundleInfo1.assetbundle, (string)assetBundleInfo1.asset, string.Empty);

            agent.Animation.SetAnimatorController(rac1);
            AssetBundleInfo           assetBundleInfo2 = playState2.MainStateInfo.AssetBundleInfo;
            RuntimeAnimatorController rac2             = AssetUtility.LoadAsset <RuntimeAnimatorController>((string)assetBundleInfo2.assetbundle, (string)assetBundleInfo2.asset, string.Empty);

            partner.Animation.SetAnimatorController(rac2);
            agent.StartLesbianSequence(partner, info);
            agent.CurrentPoint.SetSlot((Actor)agent);
            agent.SetStand(basePointA, false, 0.0f, 0);
            partner.SetStand(basePointB, false, 0.0f, 0);
            ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.Skip <long>((IObservable <M0>)Observable.EveryLateUpdate(), 1), 5), (System.Action <M0>)(_ =>
            {
                agent.SetStand(basePointA, false, 0.0f, 0);
                partner.SetStand(basePointB, false, 0.0f, 0);
            }));
            agent.UpdateMotivation = true;
            this._isReleased       = false;
        }
 public static T LoadAsset <T>(AssetBundleInfo info) where T : Object
 {
     return(AssetUtility.LoadAsset <T>((string)info.assetbundle, (string)info.asset, (string)info.manifest));
 }
Example #7
0
 public void LoadJointData(string assetbundleName, string assetName)
 {
     this._jointData = AssetUtility.LoadAsset <JointPoser.JointData>(assetbundleName, assetName, string.Empty);
 }