Inheritance: MonoBehaviour
Esempio n. 1
0
 void Start()
 {
     theBGMController = this;
     sourceBGM        = this.GetComponent <AudioSource>();
     sourceBGM.loop   = true;
     ChangeBGM("costumNormal");
     DontDestroyOnLoad(this.gameObject);
 }
Esempio n. 2
0
 private void Awake()
 {
     Cursor.visible   = false;                   //마우스 커서가 보이지 않게 함
     Cursor.lockState = CursorLockMode.Locked;   //마우스 커서를 고정시킴
     playerHealth     = GameObject.FindGameObjectWithTag("Player").GetComponent <CompleteProject.PlayerHealth>();
     bgm      = GameObject.FindGameObjectWithTag("BGMController").GetComponent <BGMController>();
     curScene = SceneManager.GetActiveScene().buildIndex;
     DontDestroyOnLoad(gameObject);
 }
    private void Awake()
    {
        controlSpeed      = 100; // 10
        dashTester_player = transform.parent.GetComponent <DashTester>();
        dashTester_enemy  = GameObject.Find("Enemy").GetComponent <DashTester>();

        GC   = GameObject.Find("GameManager").GetComponent <GameController>();
        BGMC = GameObject.Find("SoundManager").GetComponent <BGMController>();
    }
    private void Awake()
    {
        instance = this;

        BGMTracks.Add(DayMusic);
        BGMTracks.Add(NightMusic);
        BGMTracks.Add(CaveMusic);

        ChangeMusic(2);
    }
Esempio n. 5
0
 void gameStart()
 {
     if (UIHelper.shouldMaximize())
     {
         UIHelper.MaximizeWindow();
     }
     backGroundPic.show();
     bgm = gameObject.AddComponent <BGMController>();
     shiftToServant(menu);
 }
Esempio n. 6
0
 void Awake()
 {
     if (instance != null && instance != this) {
         Destroy(this.gameObject);
         return;
     } else {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Esempio n. 7
0
    private void Start()
    {
        currnetTartget = 0;

        if (m_target != null)
        {
            m_navAgent.destination = m_target[currnetTartget].position;
        }

        bgmController = GameObject.Find("BGM").GetComponent <BGMController> (); //BGMの速度を変更するやつ
    }
Esempio n. 8
0
 private void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 9
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
    }
Esempio n. 10
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;

        DontDestroyOnLoad(this.gameObject);
    }
Esempio n. 11
0
    //public static BGMController Instance {
    //  get {
    //    return instanciaBGM;
    //}
    // }

    private void Awake()
    {
        if (instanciaBGM != null && instanciaBGM != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            instanciaBGM = this;
            DontDestroyOnLoad(instanciaBGM);
        }
    }
Esempio n. 12
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 13
0
 public override void InitializePlayer()
 {
     if (musicInstance == null)
     {
         musicInstance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Esempio n. 14
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
         DontDestroyOnLoad(this);
     }
 }
Esempio n. 15
0
 // Start is called before the first frame update
 void Start()
 {
     DontDestroyOnLoad(this.gameObject);
     Trashes       = GameObject.FindGameObjectsWithTag("Trash");
     oldTrashCount = 0;
     stage         = 0;
     audioSource   = this.gameObject.GetComponent <AudioSource>();
     bgmController = FindObjectOfType <BGMController>();
     if (SceneManager.GetActiveScene().name == "Title")
     {
         ButtonCanvas.gameObject.SetActive(false);
     }
 }
Esempio n. 16
0
    IEnumerator corrutina_FinalizarBGM()
    {
        float tiempo = volumenMinimo;

        while (tiempo > 0.0f)
        {
            tiempo    -= Time.deltaTime * 1.3f;
            BGM.volume = tiempo;
            yield return(new WaitForEndOfFrame());
        }
        BGM.volume   = 0.0f;
        instanciaBGM = null;
        Destroy(this.gameObject);
    }
Esempio n. 17
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        source = GetComponent <AudioSource>();
    }
Esempio n. 18
0
 private void Awake()
 {
     instance    = this;
     UI_BGM      = GameObject.FindWithTag("BGMController");
     audioSource = GetComponent <AudioSource>();
     if (!PlayerPrefs.HasKey("BGMVolume"))
     {
         PlayerPrefs.SetFloat("BGMVolume", 1f);
     }
     else
     {
         audioSource.volume = PlayerPrefs.GetFloat("BGMVolume");
     }
     UI_BGM.GetComponent <Slider>().value = audioSource.volume;
 }
Esempio n. 19
0
    // Use this for initialization
    void Start()
    {
        _AudioSource.clip = _AudioClip_InGame;

        _AudioSource.Play();

        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }
        DontDestroyOnLoad(this.gameObject);

        AudioSource audio = GetComponent <AudioSource>();

        audio.Play();
    }
Esempio n. 21
0
 private void Awake()
 {
     if (_instance == null)
     {
         Application.targetFrameRate = 100;
         _instance = this;
         DontDestroyOnLoad(gameObject);
         _audioSource      = this.GetComponent <AudioSource>();
         _audioSource.clip = _backMusic[0];
         _audioSource.Play();
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
Esempio n. 22
0
        public static void BGMStopPatch(ref int bgmIndex)
        {
            if (acac == null || acac.Count() <= 0)
            {
                return;
            }

            if (!BGMController.HasBGM(bgmIndex))
            {
                bgmIndex = 0;
            }
            try
            {
                System.Random rd    = new System.Random();
                int           rdidx = rd.Next() % acac.Count;
                if (!RandomPlay.Value)
                {
                    rdidx      = bgmplaying % acac.Count;
                    bgmplaying = (bgmplaying + 1) % acac.Count;
                }
                RootAS = BGMController.instance.musics[bgmIndex];
                RootAS.Stop();
                if (newbgmAS == null)
                {
                    newbgmAS = RootAS.gameObject.AddComponent <AudioSource>();
                }
                else if (ChangeFollowOri.Value)
                {
                    newbgmAS.Stop();
                    newbgmAS = RootAS.gameObject.AddComponent <AudioSource>();
                }
                else
                {
                    return;
                }

                newbgmAS.clip   = acac[rdidx];
                newbgmAS.volume = VFAudio.audioVolume * VFAudio.musicVolume;
                newbgmAS.Play();
                beginsec  = DateTime.Now.Ticks / 10000000;
                bgmlength = newbgmAS.clip.length;
            }
            catch (Exception)
            {
            }
        }
    void Awake()
    {
        //If there are any other existing instances, destroy them
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            instance = this;
        }

        audioSource        = GetComponent <AudioSource>();
        audioSource.volume = PlayerPrefs.GetFloat("MusicVol");

        //Makes sure that the game object doesn't get destroyed when changing scenes
        DontDestroyOnLoad(this.gameObject);
    }
Esempio n. 24
0
    void Start()
    {
        player      = GameObject.FindGameObjectWithTag("Player");
        hp          = player.GetComponent <CompleteProject.PlayerHealth>();
        serumUI     = GameObject.FindGameObjectWithTag("SerumUI");
        serum_count = serumUI.GetComponent <CompleteProject.SerumUITutorial>();
        serums      = GameObject.FindGameObjectWithTag("Serum");
        Create_Zombie.SetActive(false);
        soundController = GameObject.FindGameObjectWithTag("SoundController");
        audio           = soundController.GetComponent <SoundController>();
        bgmController   = GameObject.FindGameObjectWithTag("BGMController");
        bgm             = bgmController.GetComponent <BGMController>();

        audio.StartAlarm();
        bgm.day();                                                //BGM출력
        DayTimeUI.SetActive(true);                                //안내메시지 출력
        Time.timeScale   = 0f;
        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;
    }
Esempio n. 25
0
    void Start()
    {
        player      = GameObject.FindGameObjectWithTag("Player");
        hp          = player.GetComponent <PlayerHealth>();
        playerLight = GameObject.FindGameObjectWithTag("PlayerLight");
        playerLight.SetActive(false);
        serumUI     = GameObject.FindGameObjectWithTag("SerumUI");
        serum_count = serumUI.GetComponent <SerumUI>();
        serums      = GameObject.FindGameObjectsWithTag("Serum");
        Create_Zombie.SetActive(false);
        soundController = GameObject.FindGameObjectWithTag("SoundController");
        audio           = soundController.GetComponent <SoundController>();
        bgmController   = GameObject.FindGameObjectWithTag("BGMController");
        bgm             = bgmController.GetComponent <BGMController>();

        audio.Alarm();
        bgm.day();                                              //BGM출력
        DayTimeUI.SetActive(true);                              //안내메시지 출력
        RoundText.text = "Round  " + RoundNum;                  //라운드 표시
        StartCoroutine(CallDayTimeUI(2));                       //안내메시지 제거
    }
Esempio n. 26
0
 public static void BGMGetPatch(ref int bgmIndex)
 {
     if (!BGMController.HasBGM(bgmIndex))
     {
         bgmIndex = 0;
     }
     //int num = BGMController.instance.musics.Length;
     try
     {
         AudioSource audioSource = BGMController.instance.musics[bgmIndex];
         BaseAS = audioSource;
         while (ALLAS.Count < maxlen)
         {
             AudioSource nas = BaseAS.gameObject.AddComponent <AudioSource>();
             ALLAS.Add(nas);
         }
     }
     catch (Exception)
     {
     }
 }
Esempio n. 27
0
 private void Start()
 {
     code_BGM = GameObject.Find("BGM").GetComponent <BGMController>();
 }
Esempio n. 28
0
 // Use this for initialization
 void Start()
 {
     director  = GameObject.Find("GameDirector").GetComponent <GameDirector>();
     bgm       = GameObject.Find("BGM").GetComponent <BGMController>();
     highscore = PlayerPrefs.GetFloat("flipthecat.highscore", 0);
 }
Esempio n. 29
0
 public BGMController()
 {
     currentPlaying         = BGMType.none;
     BGMController.Instance = this;
     LoadAllBGM();
 }
        protected override void OnStart()
        {
            base.OnStart();

            _bgmController = _controller as BGMController;
        }
Esempio n. 31
0
 void gameStart()
 {
     backGroundPic.show();
     bgm = gameObject.AddComponent <BGMController>();
     shiftToServant(menu);
 }