コード例 #1
0
        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                Destroy(this.gameObject);
            }
            if (Instance == null)
            {
                Instance = this;
            }

            DontDestroyOnLoad(this.gameObject);

            audioSource = this.GetComponent <AudioSource>();
        }
コード例 #2
0
 public void Start()
 {
     Singleton = this;
     Singleton._currentPlayingSounds     = new Dictionary <string, int>();
     Singleton._currentPlayingSoundsLock = new Dictionary <string, bool>();
 }