コード例 #1
0
	//private AudioSettings settings;
	
	void Awake() {
		if (singleton_instance != null && singleton_instance != this) {
			Destroy(this.gameObject);
			return;
		} else {
			singleton_instance = this;
		}
		DontDestroyOnLoad(this.gameObject);
		
		speaker = gameObject.GetComponent<AudioSource>();
	}
コード例 #2
0
    //private AudioSettings settings;

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

        speaker = gameObject.GetComponent <AudioSource>();
    }