public override bool RunScriptCommand()
        {
            BattleStateManager current = BattleStateManager.current;
            bool result;

            if (current != null)
            {
                result = true;
                StageParams stageParams = current.hierarchyData.stageParams;
                ClassSingleton <AdventureSceneData> .Instance.stage = stageParams.gameObject;
                LightColorChanger lightColorChanger = ClassSingleton <AdventureSceneData> .Instance.adventureLight.GetComponent <LightColorChanger>();

                if (lightColorChanger == null)
                {
                    lightColorChanger = ClassSingleton <AdventureSceneData> .Instance.adventureLight.gameObject.AddComponent <LightColorChanger>();
                }
                BattleCameraObject battleCameraObject = stageParams.gameObject.AddComponent <BattleCameraObject>();
                battleCameraObject.sunLight             = ClassSingleton <AdventureSceneData> .Instance.adventureLight;
                battleCameraObject.camera3D             = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D;
                battleCameraObject.sunLightColorChanger = lightColorChanger;
                stageParams.SetHierarchyEnviroments(battleCameraObject);
                base.ResumeScriptEngine();
            }
            else
            {
                result = false;
            }
            return(result);
        }
        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 void Awake()
    {
        this.cameraObject = new GameObject("Camera").AddComponent <Camera>();
        Light light = new GameObject("Directioal light").AddComponent <Light>();

        this.lightColorChanger            = light.gameObject.AddComponent <LightColorChanger>();
        this.cameraObject.backgroundColor = Color.black;
        this.stageObject = new GameObject("Stage");
        base.StartCoroutine(this.isLoading());
    }
    public IEnumerator SkillInitialize(Camera renderCamera, GameObject stageObject, LightColorChanger lightColorChanger)
    {
        this._stageObject       = stageObject;
        this._lightColorChanger = lightColorChanger;
        IEnumerator skillInitialize = base.Initialize(renderCamera);

        while (skillInitialize.MoveNext())
        {
            yield return(null);
        }
        yield break;
    }
示例#5
0
    public void SetHierarchyEnviroments(BattleCameraObject cameraObject)
    {
        RenderSettings.skybox = this.skybox;
        Light sunLight = cameraObject.sunLight;

        sunLight.intensity = this.sunLightIntensity;
        LightColorChanger sunLightColorChanger = cameraObject.sunLightColorChanger;

        sunLight.bounceIntensity = this.sunLightBounceLight;
        sunLightColorChanger.SetColors(this._sunLightColor);
        sunLightColorChanger.speed = this._sunLightColorTransitionSpeed;
        sunLightColorChanger.ResetColor();
        sunLightColorChanger.transform.rotation = Quaternion.Euler(this.sunLightEulerAngle);
        sunLightColorChanger.isEnable           = true;
        Camera camera3D = cameraObject.camera3D;

        if (this.skybox != null)
        {
            camera3D.clearFlags = CameraClearFlags.Skybox;
        }
        else
        {
            camera3D.clearFlags      = CameraClearFlags.Color;
            camera3D.backgroundColor = this.skyColor;
        }
        RenderSettings.ambientMode = this.ambientMode;
        AmbientMode ambientMode = RenderSettings.ambientMode;

        if (ambientMode != AmbientMode.Skybox)
        {
            if (ambientMode != AmbientMode.Trilight)
            {
                RenderSettings.ambientLight = this.ambientLight;
            }
            else
            {
                RenderSettings.ambientSkyColor     = this.ambientLight;
                RenderSettings.ambientEquatorColor = this.ambientEquatorColor;
                RenderSettings.ambientGroundColor  = this.ambientGroundColor;
            }
        }
        else
        {
            RenderSettings.ambientLight = this.ambientLight;
        }
        RenderSettings.ambientIntensity = this.ambientIntensity;
    }
示例#6
0
        public override bool RunScriptCommand()
        {
            bool       result = true;
            string     stagePrefabPathByAttackEffectId = CommonResourcesDataMng.Instance().GetStagePrefabPathByAttackEffectId(this.stageFileName);
            GameObject original   = AssetDataMng.Instance().LoadObject(stagePrefabPathByAttackEffectId, null, true) as GameObject;
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);

            ClassSingleton <AdventureSceneData> .Instance.stage = gameObject;
            gameObject.name             = "Stage";
            gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform;
            LightColorChanger sunLightColorChanger = ClassSingleton <AdventureSceneData> .Instance.adventureLight.gameObject.AddComponent <LightColorChanger>();

            BattleCameraObject battleCameraObject = gameObject.AddComponent <BattleCameraObject>();

            battleCameraObject.sunLight             = ClassSingleton <AdventureSceneData> .Instance.adventureLight;
            battleCameraObject.camera3D             = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D;
            battleCameraObject.sunLightColorChanger = sunLightColorChanger;
            StageParams component = gameObject.GetComponent <StageParams>();

            component.SetHierarchyEnviroments(battleCameraObject);
            base.ResumeScriptEngine();
            return(result);
        }
        private IEnumerator MainRoutine()
        {
            if (this.manager.battleMode != BattleMode.Single)
            {
                this.MyDestroy();
                yield break;
            }
            AudioClip clip = Resources.Load <AudioClip>("SND");

            if (clip == null)
            {
                this.MyDestroy();
                yield break;
            }
            Transform helpUI   = this.GetFindObject("DialogHelp", this.alwaysUI.transform);
            Transform retrieUI = this.GetFindObject("DialogRetire", this.alwaysUI.transform);
            Transform menuUI   = this.GetFindObject("DialogMENU", this.alwaysUI.transform);

            if (helpUI == null || retrieUI == null || menuUI == null)
            {
                this.MyDestroy();
                yield break;
            }
            if (this.manager == null)
            {
                this.MyDestroy();
                yield break;
            }
            LightColorChanger lightColorChanger = this.manager.hierarchyData.cameraObject.sunLightColorChanger;
            Light             light             = this.manager.hierarchyData.cameraObject.sunLight;

            if (lightColorChanger == null || light == null)
            {
                this.MyDestroy();
                yield break;
            }
            this.audioS              = base.gameObject.AddComponent <AudioSource>();
            this.audioS.loop         = false;
            this.audioS.spatialBlend = 0f;
            this.audioS.playOnAwake  = false;
            this.audioS.clip         = clip;
            bool next = false;

            this.state = BattleSecureRoutine.RoutineState.WaitSkillSelectActive;
            while (this.manager.battleScreen != BattleScreen.SkillSelects)
            {
                yield return(null);
            }
            GameObject hudUI = null;

            foreach (UIRoot uiroot in this.rootList)
            {
                if (!(uiroot == null))
                {
                    Transform findObject = this.GetFindObject("HUD", uiroot.transform);
                    if (!(findObject == null))
                    {
                        hudUI = findObject.gameObject;
                        break;
                    }
                }
            }
            if (hudUI == null)
            {
                this.MyDestroy();
                yield break;
            }
            this.state = BattleSecureRoutine.RoutineState.WaitMenuUIActive;
            while (menuUI != null && !menuUI.gameObject.activeSelf)
            {
                yield return(null);
            }
            if (!(menuUI != null) || !(menuUI.gameObject != null))
            {
                this.MyDestroy();
                yield break;
            }
            bool isThreeSecondWait = false;

            this.state = BattleSecureRoutine.RoutineState.LongTapWait;
            CameraParams cameraParams;

            CharacterParams[] characters;
            while (!(helpUI == null) && !(retrieUI == null) && !(menuUI == null))
            {
                if (this.manager.hierarchyData.on2xSpeedPlay || this.manager.hierarchyData.onAutoPlay != 0)
                {
                    this.MyDestroy();
                    yield break;
                }
                if (!isThreeSecondWait && Input.GetMouseButton(0))
                {
                    Vector3 vector = this.uiCamera.ScreenToViewportPoint(Input.mousePosition);
                    if (vector.x <= 0.9f || vector.y <= 0.9f)
                    {
                        this.MyDestroy();
                        yield break;
                    }
                    this.timeCount += Time.unscaledDeltaTime;
                    if (this.timeCount > 3f)
                    {
                        isThreeSecondWait = true;
                    }
                }
                if (isThreeSecondWait && Input.GetMouseButtonDown(0))
                {
                    this.state = BattleSecureRoutine.RoutineState.LongTapWait;
                    Vector3 vector2 = this.uiCamera.ScreenToViewportPoint(Input.mousePosition);
                    if (vector2.x >= 0.1f || vector2.y >= 0.1f)
                    {
                        this.MyDestroy();
                        yield break;
                    }
                    this.tapCount++;
                    if (Time.timeScale == 0f && this.tapCount > 21)
                    {
                        next = true;
                    }
                }
                if (helpUI.gameObject.activeSelf || retrieUI.gameObject.activeSelf || !menuUI.gameObject.activeSelf)
                {
                    this.MyDestroy();
                    yield break;
                }
                if (next)
                {
                    characters   = UnityEngine.Object.FindObjectsOfType <CharacterParams>();
                    cameraParams = CameraParams.current;
                    if (cameraParams == null)
                    {
                        this.MyDestroy();
                        yield break;
                    }
                    Camera camera3D      = this.manager.hierarchyData.cameraObject.camera3D;
                    Action PlayAnimation = delegate()
                    {
                        cameraParams.PlayCameraShake();
                        foreach (CharacterParams characterParams2 in characters)
                        {
                            if (characterParams2.gameObject.activeInHierarchy)
                            {
                                characterParams2.PlayAnimation(CharacterAnimationType.attacks, SkillType.Attack, 0, null, null);
                            }
                        }
                    };
                    Action ChangeLightColor = delegate()
                    {
                        light.color = new Color(UnityEngine.Random.Range(0.5f, 1f), UnityEngine.Random.Range(0.5f, 1f), UnityEngine.Random.Range(0.5f, 1f), 1f);
                    };
                    this.skillSelectUI.SetActive(false);
                    this.alwaysUI.SetActive(false);
                    hudUI.SetActive(false);
                    lightColorChanger.enabled = false;
                    float time = Time.timeScale;
                    Time.timeScale = 1f;
                    float volume = SoundMng.Instance().VolumeBGM;
                    SoundMng.Instance().VolumeBGM = 0f;
                    this.audioS.volume = volume * 0.01f * 2f;
                    this.audioS.Play();
                    Vector3    pos = camera3D.transform.position;
                    Quaternion rot = camera3D.transform.rotation;
                    float      fov = camera3D.fieldOfView;
                    cameraParams.PlayCameraAnimation(Vector3.zero, Vector3.zero, false, true);
                    this.state = BattleSecureRoutine.RoutineState.PlayAnimation;
                    float bpmWait = 0.46f;
                    while (this.audioS.isPlaying)
                    {
                        ChangeLightColor();
                        PlayAnimation();
                        yield return(new WaitForSeconds(bpmWait * 0.5f));

                        ChangeLightColor();
                        yield return(new WaitForSeconds(bpmWait * 0.5f));
                    }
                    foreach (CharacterParams characterParams in characters)
                    {
                        if (characterParams.gameObject.activeInHierarchy)
                        {
                            characterParams.PlayAnimation(CharacterAnimationType.idle, SkillType.Attack, 0, null, null);
                        }
                    }
                    yield return(new WaitForSeconds(1f));

                    this.audioS.Stop();
                    SoundMng.Instance().VolumeBGM = volume;
                    this.skillSelectUI.SetActive(true);
                    this.alwaysUI.SetActive(true);
                    hudUI.SetActive(true);
                    Time.timeScale            = time;
                    lightColorChanger.enabled = true;
                    cameraParams.StopCameraAnimation();
                    camera3D.transform.position = pos;
                    camera3D.transform.rotation = rot;
                    camera3D.fieldOfView        = fov;
                    cameraParams.StopCameraShake();
                    this.MyDestroy();
                    yield break;
                }
                else
                {
                    yield return(null);
                }
            }
            this.MyDestroy();
            yield break;
        }