コード例 #1
0
ファイル: SceneLoader.cs プロジェクト: Run19/GGJ-LostAndFound
    /// <summary>
    /// Drag and drop the next lvl from assets
    /// </summary>
    private void OnMouseDown()
    {
        SfxManager.SingleInstance.PlaySound(clipMouseDown);
        if (!canPlayLvl)
        {
            return;
        }

        SceneManager.LoadScene(lvlToPlay);
        OnSceneLoadEvent.OnSceneLoad();
    }
コード例 #2
0
 private void Awake()
 {
     if (_singleInstance == null)
     {
         _singleInstance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #3
0
ファイル: SfxManager.cs プロジェクト: Run19/GGJ-LostAndFound
 private void Awake()
 {
     OnSceneLoadEvent.AddNotifier(this);
     if (SingleInstance == null)
     {
         SingleInstance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #4
0
 private void OnDisable()
 {
     OnSceneLoadEvent.RemoveNotifier(this);
 }
コード例 #5
0
 private void OnEnable()
 {
     OnSceneLoadEvent.AddNotifier(this);
 }