Ejemplo n.º 1
0
    //private GameObject existentCrossSceneButtonController;
    // Start is called before the first frame update
    private void Awake()
    {
        Screen.fullScreen = true;



        if (!MessageSender.GetWhetherExist())
        {
            messageSender = Resources.Load <GameObject>("Prefabs/CrossSceneMessageSender");
            existentCrossSceneMessageSender      = Instantiate(messageSender, transform.position, transform.rotation) as GameObject;
            existentCrossSceneMessageSender.name = messageSender.name;
        }
        if (!BKMusicPlayer.GetWhetherExist())
        {
            bKMusicController = Resources.Load <GameObject>("Prefabs/CrossSceneBKMusicController");
            existentCrossSceneBKMusicController      = Instantiate(bKMusicController, transform.position, transform.rotation) as GameObject;
            existentCrossSceneBKMusicController.name = bKMusicController.name;
        }
        if (!ButtonSoundPlayer.GetWhetherExist())
        {
            buttonSoundController = Resources.Load <GameObject>("Prefabs/CrossSceneButtonSoundController");
            existentCrossSceneButtonSoundController      = Instantiate(buttonSoundController, transform.position, transform.rotation) as GameObject;
            existentCrossSceneButtonSoundController.name = buttonSoundController.name;
        }

        /*
         * if (!ButtonController.whetherExist)
         * {
         *  existentCrossSceneButtonController= Instantiate(buttonController, transform.position, transform.rotation) as GameObject;
         *  existentCrossSceneButtonController.name = buttonController.name;
         * }
         */
    }
Ejemplo n.º 2
0
    //***************************************************************************
    //生命周期

    private void Awake()
    {
        BKMusicPlayer.whetherExist = true;
        BKMusicPlayer.theExistentBKMusicController = this.gameObject;
        audioSourceOfBKMusic      = BKMusicPlayer.theExistentBKMusicController.GetComponent <AudioSource>();
        BKMusicPlayer.theInstance = this;
        DontDestroyOnLoad(this.gameObject);
    }
Ejemplo n.º 3
0
 public void SetBKMusicVolume()
 {
     BKMusicPlayer.GetTheInstance().SetVolume(slider.value);
 }
Ejemplo n.º 4
0
 private void Awake()
 {
     slider       = GetComponent <Slider>();
     slider.value = BKMusicPlayer.GetTheInstance().GetVolume();
 }