コード例 #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     soundObject = GameObject.Find("BackgroundMusic");
     audioSource = soundObject.GetComponent <AudioSource>();
 }
コード例 #2
0
 public void Initialization(int x_axis, int z_axis, Maze maze, BackgroundMusicController _musicController)
 {
     sizeZ           = z_axis;
     sizeX           = x_axis;
     mazeInstance    = maze;
     musicController = _musicController;
     openDooreffect  = this.GetComponent <AudioSource>();
     openDooreffect.PlayOneShot(openTheDoorClip);
     isBossDead = false;
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     loginQuickReq = new LoginDataQuickReq();
     ConnectionManager.GetInstance().Connect(delegate(bool isSuc)
     {
         if (isSuc)
         {
         }
     });
     BackgroundMusicController.PlayMusic(6);
 }
コード例 #4
0
 // Use this for initialization
 void Awake()
 {
     Current             = this;
     _bgMusicSource      = gameObject.AddComponent <AudioSource>();
     _bgMusicSource.clip = BgMusic;
     _bgMusicSource.loop = true;
     if (SoundManager.Instance.IsMusicOn())
     {
         _bgMusicSource.Play();
     }
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
コード例 #6
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #7
0
    // private void CreateTrashes(Switch sw){

    //     int randSeed = Random.Range(0,3);
    //     Trash m_trash = Instantiate(trash_type_list[ randSeed ]) as Trash;
    //     m_trash.transform.position = sw.transform.position;
    //     trash_instance_list.Add(m_trash);
    // }
    // public void DestoryTrash(){
    //     foreach(Trash trash in trash_instance_list){
    //         Destroy(trash.gameObject);
    //     }
    // }
    private void BeginGame()
    {
        // create maze instance from prefab
        switchCount        = 0;
        mazeInstance       = Instantiate(mazePrefab) as Maze;
        mazeInstance.sizeX = size;
        mazeInstance.sizeZ = size;
        mazeInstance.Generate();
        playerInstance = Instantiate(playerPrefab) as Player;
        playerInstance.gameObject.name = "unitychan(Clone)";
        musicContollerInstance         = Instantiate(musicController) as BackgroundMusicController;
    }
コード例 #8
0
 private void Awake()
 {
     if (bgmc != null)
     {
         Destroy(gameObject);
     }
     else
     {
         bgmc = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #9
0
    private void Awake()
    {
        if (!MakeSingleton())
        {
            return;
        }

        SaveManager          = GetComponent <SaveManager>();
        MusicController      = GetComponent <BackgroundMusicController>();
        TransitionController = GetComponent <TransitionController>();
        EquipmentManager     = GetComponent <EquipmentManager>();
    }
コード例 #10
0
 // Update is called once per frame
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
     SceneManager.activeSceneChanged += DestroyOnMenuScreen;
 }
コード例 #11
0
 private void Awake()
 {
     Debug.Log("audio level is 1");
     // First we check if there are any other instances conflicting
     if (instance != null)
     {
         // If that is the case, we destroy other instances
         Destroy(gameObject);
         //Debug.Log("destroyed instance of background music" + gameObject);
     }
     else if (instance == null)
     {
         // Here we save our singleton instance
         instance = this;
         //Debug.Log("instance saved as " + this);
         // Furthermore we make sure that we don't destroy between scenes (this is optional)
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #12
0
 // Use this for initialization
 void Awake()
 {
     m_bgMusicController = this;
 }
コード例 #13
0
 void Awake()
 {
     singleton = this;
     DontDestroyOnLoad(this);
 }
コード例 #14
0
 void Awake()
 {
     Instance = this;
 }
コード例 #15
0
 private void Awake()
 {
     instance = this;
     audio    = GetComponent <AudioSource>();
     FadeInBackgroundMusic();
 }
コード例 #16
0
 void Awake()
 {
     singleton = this;
     DontDestroyOnLoad(this);
 }