public override bool RunScriptCommand()
        {
            AdventureDigimonInfo adventureDigimonInfo = new AdventureDigimonInfo
            {
                id = this.charaId
            };
            bool flag;

            if ("clearAnime" == this.clearAnimeFlag)
            {
                flag = this.LoadDigimonNotCharaParams(this.monsterGroupId, adventureDigimonInfo);
                if (flag)
                {
                    ClassSingleton <AdventureSceneData> .Instance.digimonInfoList.Add(adventureDigimonInfo);

                    base.ResumeScriptEngine();
                }
            }
            else
            {
                flag = this.LoadDigimon(this.monsterGroupId, adventureDigimonInfo);
                if (flag)
                {
                    ClassSingleton <AdventureSceneData> .Instance.digimonInfoList.Add(adventureDigimonInfo);

                    base.ResumeScriptEngine();
                }
            }
            return(flag);
        }
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                CharacterParams        component  = digimonInfo.model.GetComponent <CharacterParams>();
                InvocationEffectParams component2 = digimonInfo.skillEffectList[this.uniqueSkillIndex].GetComponent <InvocationEffectParams>();
                LightColorChanger      component3 = ClassSingleton <AdventureSceneData> .Instance.adventureLight.GetComponent <LightColorChanger>();

                IEnumerator enumerator = component2.SkillInitialize(ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D, ClassSingleton <AdventureSceneData> .Instance.stage, component3);
                while (enumerator.MoveNext())
                {
                }
                CameraParams component4 = digimonInfo.skillCameraAnimation[this.uniqueSkillIndex].GetComponent <CameraParams>();
                string       text       = digimonInfo.skillEffectSeList[this.uniqueSkillIndex];
                if (null != component && null != component2 && null != component4 && !string.IsNullOrEmpty(text))
                {
                    component.PlayAnimation(CharacterAnimationType.attacks, SkillType.Deathblow, this.uniqueSkillIndex, null, null);
                    component2.transform.position = component.transform.position;
                    component4.transform.position = component.transform.position;
                    AppCoroutine.Start(component2.PlaySkillAnimation(component), new Action(this.OnFinishCommand), false);
                    component4.currentTargetCamera = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D;
                    component4.PlayCameraAnimation(component, false, false);
                    SoundMng.Instance().TryPlaySE("SE/" + text + "/sound", 0f, false, true, null, -1);
                    base.SetContinueAnalyzeForAnimationWaitTime(this.isWaitFlag);
                    result = true;
                }
            }
            return(result);
        }
        private bool LoadDigimonNotCharaParams(string monsterGroupId, AdventureDigimonInfo digimonInfo)
        {
            bool result = true;

            try
            {
                MonsterClientMaster monsterMasterByMonsterGroupId = MonsterMaster.GetMonsterMasterByMonsterGroupId(monsterGroupId);
                string     modelId    = monsterMasterByMonsterGroupId.Group.modelId;
                string     filePath   = MonsterObject.GetFilePath(modelId);
                GameObject original   = AssetDataMng.Instance().LoadObject(filePath, null, true) as GameObject;
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                gameObject.name             = "Digimon_" + monsterGroupId;
                gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform;
                gameObject.SetActive(false);
                digimonInfo.model = gameObject;
                CharacterParams component = gameObject.GetComponent <CharacterParams>();
                UnityEngine.Object.Destroy(component);
                CapsuleCollider component2 = gameObject.GetComponent <CapsuleCollider>();
                UnityEngine.Object.Destroy(component2);
                Transform transform = gameObject.transform;
                for (int i = 0; i < transform.childCount; i++)
                {
                    Animation component3 = transform.GetChild(i).GetComponent <Animation>();
                    UnityEngine.Object.Destroy(component3);
                }
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Exemple #4
0
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                Transform child = digimonInfo.model.transform.GetChild(0);
                if (null != child)
                {
                    digimonInfo.animator = child.GetComponent <Animator>();
                    if (null == digimonInfo.animator)
                    {
                        digimonInfo.animator = child.gameObject.AddComponent <Animator>();
                    }
                    string path = "AdventureScene/Animation/Character/" + this.animatorFileName;
                    digimonInfo.animator.runtimeAnimatorController = (AssetDataMng.Instance().LoadObject(path, null, true) as RuntimeAnimatorController);
                    if (null != digimonInfo.animator.runtimeAnimatorController)
                    {
                        result = true;
                        base.ResumeScriptEngine();
                    }
                }
            }
            return(result);
        }
Exemple #5
0
        public override bool RunScriptCommand()
        {
            bool            flag            = false;
            AdventureCamera adventureCamera = ClassSingleton <AdventureSceneData> .Instance.adventureCamera;
            string          text            = this.locatorOwnerFlag;

            if (text != null)
            {
                if (!(text == "stage"))
                {
                    if (!(text == "chara"))
                    {
                        if (!(text == "stageLoc"))
                        {
                            if (text == "charaLoc")
                            {
                                AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

                                if (digimonInfo != null)
                                {
                                    flag = adventureCamera.SetTargetCharaLocator(digimonInfo.model, this.locatorName, this.isFollowingFlag);
                                }
                            }
                        }
                        else
                        {
                            flag = adventureCamera.SetTargetStageLocator(this.locatorName, this.isFollowingFlag);
                        }
                    }
                    else
                    {
                        AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

                        if (digimonInfo != null)
                        {
                            adventureCamera.SetTargetChara(digimonInfo.model, this.isFollowingFlag);
                            flag = true;
                        }
                    }
                }
                else
                {
                    adventureCamera.SetLookAt(this.lookAtPosition, this.stageLocalPosition);
                    flag = true;
                }
            }
            if (flag)
            {
                base.ResumeScriptEngine();
            }
            return(flag);
        }
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null && null != digimonInfo.animator)
            {
                digimonInfo.animator.Play(this.animatorStateName, 0, 0f);
                base.SetContinueAnalyzeForAnimationWaitTime(this.isWaitFlag);
                result = true;
            }
            return(result);
        }
Exemple #7
0
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                digimonInfo.model.transform.localRotation = Quaternion.Euler(this.rotationEulerAngles);
                base.ResumeScriptEngine();
                result = true;
            }
            return(result);
        }
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                digimonInfo.model.transform.localPosition = this.stageLocalPosition;
                result = true;
                base.ResumeScriptEngine();
            }
            return(result);
        }
Exemple #9
0
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                bool active = "on" == this.showFlag;
                digimonInfo.model.SetActive(active);
                result = true;
            }
            base.ResumeScriptEngine();
            return(result);
        }
        private bool LoadDigimon(string monsterGroupId, AdventureDigimonInfo digimonInfo)
        {
            bool result = true;

            try
            {
                MonsterClientMaster monsterMasterByMonsterGroupId = MonsterMaster.GetMonsterMasterByMonsterGroupId(monsterGroupId);
                string     modelId    = monsterMasterByMonsterGroupId.Group.modelId;
                string     path       = MonsterObject.GetFilePath(modelId);
                GameObject original   = AssetDataMng.Instance().LoadObject(path, null, true) as GameObject;
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                gameObject.name             = "Digimon_" + monsterGroupId;
                gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform;
                gameObject.SetActive(false);
                digimonInfo.model = gameObject;
                List <GameWebAPI.RespDataMA_GetSkillM.SkillM> list;
                if (!this.LoadUniqueSkill(monsterGroupId, out list))
                {
                    throw new Exception("Error : 固有スキルの読み込みに失敗");
                }
                for (int i = 0; i < list.Count; i++)
                {
                    int num  = list[i].skillGroupSubId.ToInt32();
                    int num2 = num - 1;
                    path                        = CommonResourcesDataMng.Instance().GetUniqueSkillPrefabPathByAttackEffectId(list[i].attackEffect);
                    original                    = (AssetDataMng.Instance().LoadObject(path, null, true) as GameObject);
                    gameObject                  = UnityEngine.Object.Instantiate <GameObject>(original);
                    gameObject.name             = "SkillEffect_" + list[i].attackEffect;
                    gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform;
                    gameObject.SetActive(false);
                    digimonInfo.skillEffectList[num2] = gameObject;
                    InvocationEffectParams component = gameObject.GetComponent <InvocationEffectParams>();
                    path                        = CommonResourcesDataMng.Instance().GetCameraMotionPrefabPathByCameraId(component.cameraMotionId);
                    original                    = (AssetDataMng.Instance().LoadObject(path, null, true) as GameObject);
                    gameObject                  = UnityEngine.Object.Instantiate <GameObject>(original);
                    gameObject.name             = "CameraAnime_" + component.cameraMotionId;
                    gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform;
                    gameObject.SetActive(false);
                    digimonInfo.skillCameraAnimation[num2] = gameObject;
                    digimonInfo.skillEffectSeList[num2]    = list[i].soundEffect;
                }
            }
            catch
            {
                result = false;
                digimonInfo.Delete();
            }
            return(result);
        }
Exemple #11
0
        public override bool RunScriptCommand()
        {
            bool flag = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                flag = AdventureObject.SetLocator(digimonInfo.model.transform, ClassSingleton <AdventureSceneData> .Instance.stage.transform, this.stageLocatorName, this.isFollowingFlag);
                if (flag)
                {
                    base.ResumeScriptEngine();
                }
            }
            return(flag);
        }
        public override bool UpdateCommand()
        {
            if (this.isWaitFlag)
            {
                AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

                if (digimonInfo == null || !(null != digimonInfo.animator))
                {
                    return(false);
                }
                AnimatorStateInfo currentAnimatorStateInfo = digimonInfo.animator.GetCurrentAnimatorStateInfo(0);
                if (currentAnimatorStateInfo.IsName(this.finishAnimatorStateName) && 1f <= currentAnimatorStateInfo.normalizedTime)
                {
                    base.ResumeScriptEngine();
                }
            }
            return(true);
        }
        public void OnFinishCommand()
        {
            if (this.isWaitFlag)
            {
                base.ResumeScriptEngine();
                AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

                if (digimonInfo != null)
                {
                    for (int i = 0; i < digimonInfo.skillCameraAnimation.Length; i++)
                    {
                        if (null != digimonInfo.skillCameraAnimation[i] && digimonInfo.skillCameraAnimation[i].activeSelf)
                        {
                            digimonInfo.skillCameraAnimation[i].SetActive(false);
                        }
                    }
                }
            }
        }
Exemple #14
0
        public override bool RunScriptCommand()
        {
            bool flag = true;
            AdventureEffectInfo effectInfo = ClassSingleton <AdventureSceneData> .Instance.GetEffectInfo(this.effectId);

            if (effectInfo != null)
            {
                if ("stage" == this.locatorType)
                {
                    flag = AdventureObject.SetLocator(effectInfo.model.transform, ClassSingleton <AdventureSceneData> .Instance.stage.transform, this.locatorName, this.isFollowingFlag);
                }
                else if ("chara" == this.locatorType)
                {
                    AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

                    if (digimonInfo != null)
                    {
                        flag = AdventureObject.SetLocator(effectInfo.model.transform, digimonInfo.model.transform, this.locatorName, this.isFollowingFlag);
                    }
                }
                else
                {
                    Quaternion localRotation = effectInfo.model.transform.localRotation;
                    Vector3    localPosition = effectInfo.model.transform.localPosition;
                    Vector3    localScale    = effectInfo.model.transform.localScale;
                    effectInfo.model.transform.parent        = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D.transform;
                    effectInfo.model.transform.localScale    = localScale;
                    effectInfo.model.transform.localPosition = localPosition;
                    effectInfo.model.transform.localRotation = localRotation;
                }
            }
            if (flag)
            {
                base.ResumeScriptEngine();
            }
            return(flag);
        }