예제 #1
0
 void StartFadeOut()
 {
     fadeImage.enabled = true;
     alfa  += fadeSpeed1;
     alfa1 += fadeSpeed1;
     SetAlpha();
     if (alfa >= 1)
     {
         BGM.Stop();
         SE.play(0);
         ibrek[karad].SetActive(false);
         if (uramodo == 0)
         {
             karad = UnityEngine.Random.Range(0, 16);
         }
         else if (uramodo == 1)
         {
             karad = 7;
         }
         gamemane.GetComponent <sentak>().keltutei();
         gamemane.GetComponent <start>().end();
         ibrek[karad].SetActive(true);
         a = 0;
         gamemane.GetComponent <parameter>().iro();
     }
 }
예제 #2
0
            /// <summary>
            /// 写入INI
            /// </summary>
            public static void IniW()
            {
                IniW RA2CA = new IniW(AppDomain.CurrentDomain.BaseDirectory + "ra2ca.ini");

                if (IsWindow)
                {
                    RA2CA.IniWriteValue("Video", "Video.Windowed", "1");
                }
                else
                {
                    RA2CA.IniWriteValue("Video", "Video.Windowed", "0");
                }

                if (NoFrame)
                {
                    RA2CA.IniWriteValue("Video", "NoWindowFrame", "1");
                }
                else
                {
                    RA2CA.IniWriteValue("Video", "NoWindowFrame", "0");
                }

                RA2CA.IniWriteValue("Options", "Difficulty", Difficult.ToString());

                RA2CA.IniWriteValue("Audio", "SoundVolume", BGM.ToString());
                RA2CA.IniWriteValue("Audio", "VoiceVolume", VOX.ToString());
                RA2CA.IniWriteValue("Audio", "ScoreVolume", SEM.ToString());

                RA2CA.IniWriteValue("Video", "ScreenWidth", Width.ToString());
                RA2CA.IniWriteValue("Video", "ScreenHeight", Height.ToString());
            }
예제 #3
0
    public void PlayBGM(BGM bgm)
    {
        if (!bgmAudioS)
        {
            return;
        }

        bgmAudioS.Stop();

        AudioClip audioToPlay = sfx_uiError;

        switch (bgm)
        {
        case BGM.MORNING:
            audioToPlay = bgm_morning;
            break;

        case BGM.AFTERNOON:
            audioToPlay = bgm_afternoon;
            break;

        case BGM.NIGHT:
            audioToPlay = bgm_night;
            break;
        }
        StartCoroutine("FadeOutAndIn", audioToPlay);
    }
예제 #4
0
    // BGMを変更する
    public void BGMChange(BGM bgm)
    {
        string pass;

        switch (bgm)
        {
        case BGM.GAME:
            pass = "******";
            break;

        case BGM.TITLE:
            pass = "******";
            break;

        case BGM.RESULT:
            pass = "******";
            break;

        default:
            pass = "";
            break;
        }
        AudioClip bgmClip = Resources.Load <AudioClip> (pass);

        bgm_audio.clip = bgmClip;
        bgm_audio.Play();
    }
예제 #5
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == "Player")
        {
            if (leadsToBoss)
            {
                if (!playingBossSong)
                {
                    // PLAY BOSS SONG
                    playingBossSong = true;
                    BGM.PlayBossBGM();
                }
            }

            PlayerMovement Player = GameObject.Find("PlayerPivot").GetComponent <PlayerMovement>();
            if (other.transform.position.x < transform.position.x)
            {
                direction = 1;
            }
            else
            {
                direction = -1;
            }

            playerMov.setAutoMoving(true);

            for (int i = 0; i < playerMove; i++)
            {
                Player.QueueAnimation(new AnimationItem(Vector3.right * direction, Player.baseSpeed, true, true));
            }

            camAnimation.MoveCamera(direction, island.cameraShift);
        }
    }
예제 #6
0
 void Start()
 {
     gs    = GetComponent <GameState>();
     uup   = GetComponent <UIUpdater>();
     bgm   = GameObject.Find("BGM").GetComponent <BGM>();
     trans = GameObject.Find("Transition").GetComponent <gameOverTransition>();
 }
예제 #7
0
    /// <summary>
    /// 再生
    /// </summary>
    /// <param name="type"></param>
    public void Play(BGM bgm)
    {
        //再生前にBGMを止める
        if (bgmSource.isPlaying)
        {
            bgmSource.Stop();
        }

        //分岐
        switch (bgm)
        {
        case BGM.Title:
            bgmSource.clip = titleClip;
            break;

        case BGM.Game:
            bgmSource.clip = MainClip;
            break;

        case BGM.Result:
            bgmSource.clip = resultClip;
            break;

        case BGM.GameOver:
            bgmSource.clip = gameOverClip;
            break;
        }
        bgmSource.Play();
    }
예제 #8
0
 public static EventBGM c(BGM bgm, float volume = .5f)
 {
     return(new EventBGM()
     {
         myBGM = bgm, myVolume = volume
     });
 }
예제 #9
0
 void Start()
 {
     control        = GetComponent <Control> ();
     characterSound = GetComponent <CharacterSound> ();
     hurt           = GameObject.Find("Hurt").GetComponent <FadeImage> ();
     gameBGM        = GameObject.Find("Game").GetComponent <BGM> ();
 }
예제 #10
0
    // Use this for initialization
    void Start()
    {
        slider = GetComponent <Slider>();
        bgm1   = BGM.instance;
        bgm2   = BGM2.instance;

        slider.value = bgm1.GetComponent <AudioSource>().volume;
    }
예제 #11
0
 // Use this for initialization
 void Start()
 {
     bgm = GameObject.Find("Sound").GetComponent <BGM>();
     if (!bgm.audio.isPlaying)
     {
         bgm.BGMPlay();
     }
 }
예제 #12
0
    public void PlayBGM(BGM bgm)
    {
        audioSourceBGM.volume = 1;
        int index = (int)bgm;

        audioSourceBGM.clip = clipsBGM[index];
        audioSourceBGM.Play();
    }
예제 #13
0
 private void OnLevelWasLoaded(int level)
 {
     if (level != 1)
     {
         instance = null;
         Destroy(this.gameObject);
     }
 }
예제 #14
0
 public void PlayAudio_BGM(BGM _clip)
 {
     AudioSource_BGM.clip = AudioClips_BGM[(int)_clip];
     if (AudioSource_BGM.clip != null && AudioSource_BGM.enabled == true)
     {
         AudioSource_BGM.Play();
     }
 }
예제 #15
0
    // BGM 실행하기 위한 함수
    public void PlayBGM(BGM bgm, float volume = 1.0f)
    {
        BGMSource.volume = MasterVolume * volume;
        BGMSource.clip   = dBGMClips[bgm];
        BGMSource.loop   = true;

        BGMSource.Play();
    }
예제 #16
0
    public void PlayBGM(BGM bgm)
    {
        var s = bgm.ToString();
        var i = BGMNames.FindIndex(x => x == s);

        BGMAudioSource.clip = BGMList[i];
        BGMAudioSource.Play();
    }
예제 #17
0
 /// <summary>
 /// Returns the appropriate AudioClip. If None, then returns null
 /// </summary>
 private AudioClip GetBGM(BGM clip)
 {
     if (clip == BGM.None)
     {
         return(null);
     }
     return(BGM_clips[(int)clip]);
 }
예제 #18
0
 private void Awake()
 {
     bgm           = GameObject.Find("BGM").GetComponent <BGM>();
     sfx           = GameObject.Find("SFX").GetComponent <SFX>();
     board         = GameObject.Find("Board").GetComponent <Board>();
     scoreTotal    = GameObject.Find("ScoreTotal").GetComponent <TextMeshProUGUI>();
     settingButton = GameObject.Find("SettingButton");
 }
예제 #19
0
 public void checkIfGameOver()
 {
     if (currHealth == 0)
     {
         gameOver = true;
         gameOverScreen.SetActive(true);
         BGM.GameOver(gameOverScreenTime);
     }
 }
예제 #20
0
 public void PlayBGM(BGM bgm)
 {
     if (bgms[(int)bgm] != sources[0].clip)
     {
         sources[0].volume = bgmVolumes[(int)bgm] * bgmMasterVolume;
         sources[0].clip   = bgms[(int)bgm];
         sources[0].Play();
     }
 }
예제 #21
0
 public Sound(Vector3 pos, BGM bgm)
 {
     //soundObjectを座標posへ生成し、再生させるBGMを設定します
     soundObject = new GameObject("EmptySoundObject");
     audioSource = soundObject.AddComponent <AudioSource>();
     soundObject.AddComponent <SoundDestroyer>();
     soundObject.transform.position = pos;
     SetSound(bgm);
 }
예제 #22
0
 /// <summary>
 /// 换歌
 /// </summary>
 /// <param 歌名="bgmName"></param>
 public void ReplaceBGM(BGM bgmType)
 {
     clip                 = ResourcesManager.Instance.FindAudioClip(bgmType);
     bgMusic.clip         = null;
     bgMusic.clip         = clip;
     bgMusic.spatialBlend = 0f;
     bgMusic.loop         = true;
     bgMusic.Play();
 }
예제 #23
0
 //引数のBGMをマスターソースに入れて再生
 public void Play_BGM(BGM bgm)
 {
     if (null != bgmSourceMaster)
     {
         Stop_BGM();
     }
     bgmSourceMaster = bgmSource [(int)bgm];
     bgmSourceMaster.Play();
 }
예제 #24
0
    private bool _selectButton;        //はじめから・つづきからを選択したかどうか管理

    void Start()
    {
        _pushtext       = GameObject.Find("PushText").GetComponent <Text>();
        _bgm            = FindObjectOfType <BGM>();
        _se             = FindObjectOfType <SE>();
        _flashingtime   = 0.0f;
        _flashingSecond = 4.0f;
        _setAlpha       = 0.5f;
    }
예제 #25
0
 public void Init()
 {
     _background = this.transform.parent.GetComponent <GameEngine>().background;
     _distractor = this.transform.parent.GetComponent <GameEngine>().distractor;
     _character  = this.transform.parent.GetComponent <GameEngine>().character;
     _dialogue   = this.transform.parent.GetComponent <GameEngine>().dialogue;
     _bgm        = this.transform.parent.GetComponent <GameEngine>().bgm;
     _se         = this.transform.parent.GetComponent <GameEngine>().se;
 }
예제 #26
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        m_audio = GetComponent <AudioSource>();
    }
예제 #27
0
파일: BGM.cs 프로젝트: dka271/AGAIN-
	void Awake() {
		if (instance != null && instance != this) {
			Destroy(this.gameObject);
			return;
		} else {
			instance = this;
		}
		DontDestroyOnLoad(this.gameObject);
	}
예제 #28
0
        public RenderAudioScene(Game game, string inputPath, string outputPath)
            : base(game, false)
        {
            if (string.IsNullOrEmpty(outputPath))
            {
                Log.Error("Output is missing");
                return;
            }

            Chart chart = Chart.Load(inputPath);

            chart.GenerateEvents();

            if (string.IsNullOrWhiteSpace(Path.GetExtension(outputPath)))
            {
                outputPath += ".wav";
            }

            // preload all audio
            Loader loader = new Loader(chart, audio);

            loader.PreloadAll(true, false);

            songPlayer = new BGM(chart, audio);
            autoplay   = new Player(chart, audio, null, null);

            songPlayer.realtime = false;
            autoplay.realtime   = false;

            autoplay.autoplay = true;

            songPlayer.StartPlayer();
            autoplay.StartPlayer();

            songPlayer.Update(1.0f);
            autoplay.Update(1.0f);

            if (songPlayer.playing || autoplay.playing)
            {
                throw new ApplicationException("Players did not finish as expected");
            }

            Log.Info("Rendering audio...");
            byte[] audioData = audio.RenderAudio();

            if (audioData.Length > 0)
            {
                Log.Info("Saving audio...");
                FFmpegHelper.SaveSound(outputPath,
                                       audioData, audioData.Length / 4, audio.audioSpec.freq);
            }
            else
            {
                Log.Warning("No audio was rendered");
            }
        }
예제 #29
0
파일: BGM.cs 프로젝트: 407351129/charlie
    // Start is called before the first frame update

    // Start is called before the first frame update
    private void Awake()
    {
        if (Bg_Instance != null && Bg_Instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        Bg_Instance = this;
        DontDestroyOnLoad(this);
    }
예제 #30
0
 /// <summary>
 /// 播放背景音乐
 /// </summary>
 /// <param name="name">音乐文件名</param>
 public void PlayBGM(string name)
 {
     // 异步加载背景音乐并播放
     ResMgr.Instance.LoadAsync <AudioClip>(BGMpath + name, (clip) => {
         BGM.clip   = clip;
         BGM.volume = bgmVolume;
         BGM.loop   = true;
         BGM.Play();
     });
 }
예제 #31
0
    // Use this for initialization
    void Start () {

        bgm = GameObject.Find("Sound").GetComponent<BGM>();
        
        if (SceneManager.GetActiveScene().name == "StartMenu")
            bgm.BGMPlay();
        else if (!bgm.audio.isPlaying)
            bgm.BGMPlay();

    }
예제 #32
0
 void Awake()
 {
     if (instance != null && instance != this) {
         Destroy(this.gameObject);
         return;
     } else {
         instance = this;
         bgm = GetComponent<AudioSource>();
     }
     DontDestroyOnLoad(this.gameObject);
     Play();
 }
예제 #33
0
    // Use this for initialization
    void Start()
    {
        GameObject audioObject = GameObject.FindWithTag("Audio");

        if (audioObject != null)
        {
            audioManager = audioObject.GetComponent<BGM>();
        }
        if (audioManager == null)
        {
            Debug.Log("Cannot find 'BGM' script");
        }
    }
예제 #34
0
    /// <summary>
    /// BGMの再生
    /// </summary>
    public void PlayBGM(BGM type, bool loop = true, bool overlap = false)
    {
        if(useBGM)
        {
            if(!overlap)
            {
                if(audioSource_BGM.isPlaying)
                    audioSource_BGM.Stop();
            }

            audioSource_BGM.volume = volBGM;

            switch(type)
            {
                case BGM.WAIT:
                    if(BGM_Wait != null)
                    {
                        audioSource_BGM.clip = BGM_Wait;
                        audioSource_BGM.loop = loop;
                        audioSource_BGM.Play();
                    }
                    break;

                case BGM.PLAY:
                    if(BGM_Play != null)
                    {
                        audioSource_BGM.clip = BGM_Play;
                        audioSource_BGM.loop = loop;
                        audioSource_BGM.Play();
                    }
                    break;

                default: break;
            }
        }
    }
예제 #35
0
 private void playBGM(int mode)
 {
     NeedToStopBGM = false;
     if (Preferences.GetBoolean("Sound") && Preferences.GetBoolean("Music"))
     {
         CurrentBGM = (BGM)(mode % (int)BGM.Count);
         NeedToStartBGM = true;
         if (bgmThread == null)
         {
             bgmThread = new Thread(new ThreadStart(playMusicInBackground));
             bgmThread.Name = "BGM Thread";
             bgmThread.Start();
         }
     }
 }
예제 #36
0
    // Use this for initialization
    void Start()
    {
        if(PlayerPrefs.GetInt("highscore") != null)
        {
            highscore = PlayerPrefs.GetInt("highscore");
        }

        score = 0;
        UpdateScore ();
        restart = false;

           // restartText.GetComponent<Text>().text = "";

        gameOverText.GetComponent<Text>().text = "";

        GameObject audioObject = GameObject.FindWithTag("Audio");

        if (audioObject != null)
        {
            audioManager = audioObject.GetComponent<BGM>();
        }
        if (audioManager == null)
        {
            Debug.Log("Cannot find 'BGM' script");
        }

        Vector3 position = new Vector3(0, 0, 0);
        //Instantiate (player, position , Quaternion.identity);

        restartButton = GameObject.FindGameObjectWithTag("Restart_Button").GetComponent<Button>();
        restartButton.gameObject.SetActive(false);

        menuButton = GameObject.FindGameObjectWithTag("Menu_Button").GetComponent<Button>();
        menuButton.gameObject.SetActive(false);
    }