Example #1
0
        public override void Run()
        {
            bgm.volume = PlayerPrefs.GetFloat("bgm");
            // 1 : default bgm , -1 : stop
            int index = -1;
            ScenarioResource resource = ScenarioResource.GetInstace();

            if (command["id"] != null)
            {
                index = Convert.ToInt32(command["id"]);
            }
            AudioClip audioClip = resource.GetBGM(index);

            if (audioClip != null)
            {
                bgm.clip = audioClip;
                bgm.Play();
            }
            else
            {
                bgm.Stop();
            }

            isEndGame = true;
        }
Example #2
0
        public override void Run()
        {
            se.volume = PlayerPrefs.GetFloat("sfx");
            // 1 : default bgm , -1 : stop

            int index = -1;
            ScenarioResource resource = ScenarioResource.GetInstace();

            if (command["id"] != null)
            {
                index = Convert.ToInt32(command["id"]);
            }
            AudioClip audioClip = resource.GetSFX(index);

            if (audioClip != null)
            {
                //se.clip = audioClip;
                se.PlayOneShot(audioClip);
            }
            else
            {
                se.Stop();
            }

            isEndGame = true;
        }
Example #3
0
        public override void Run()
        {
            int index=-1;
            ScenarioResource resource = ScenarioResource.GetInstace();

            if (command["id"] != null)
            {
                index = Convert.ToInt32(command["id"]);
                if (index == -1)
                {
                    imageBackgound.gameObject.SetActive(false);
                }
                else
                {
                    imageBackgound.gameObject.SetActive(true);
                }
            }

            Sprite sprite = resource.GetBackground(index);
            imageBackgound.sprite = sprite;
            isEndGame = true;
            
        }
Example #4
0
        public override void Run()
        {
            switch (command["position"])
            {
            case "left":
                characterImage = root.transform.Find("Character1").GetComponent <Image>();
                animator       = root.transform.Find("Character1").GetComponent <Animator>();
                break;

            case "center":
                characterImage = root.transform.Find("Character2").GetComponent <Image>();
                animator       = root.transform.Find("Character2").GetComponent <Animator>();
                break;

            case "right":
                characterImage = root.transform.Find("Character3").GetComponent <Image>();
                animator       = root.transform.Find("Character3").GetComponent <Animator>();
                break;

            case "photo":
                characterImage = root.transform.Find("Photo").GetComponent <Image>();
                break;

            case "ghost":
                characterImage = root.transform.Find("Ghost").GetComponent <Image>();
                characterImage.gameObject.SetActive(true);
                break;

            default:
                return;
            }

            int characterID = Convert.ToInt32(command["chara_id"]);
            int index;
            ScenarioResource resource = ScenarioResource.GetInstace();


            if (command["id"] != null)
            {
                index = Convert.ToInt32(command["id"]);
            }
            else
            {
                index = -1;
            }
            if (command["flip"] != null)
            {
                if (command["flip"].ToString() == "right")
                {
                    characterImage.transform.localRotation = Quaternion.Euler(0, 180, 0);
                }
                else
                {
                    characterImage.transform.localRotation = Quaternion.Euler(0, 0, 0);
                }
            }

            if (command["fade"] != null)
            {
                if (characterID == 0)
                {
                    Fade();
                }
                else if (characterID == 1)
                {
                    Fade();
                }
                else if (characterID == 2)
                {
                    Fade();
                }
            }



            Sprite sprite = resource.GetCharacter(characterID, index);

            characterImage.sprite = sprite;
            characterImage.gameObject.SetActive(index >= 0);
            isEndGame = true;
        }