Exemple #1
0
 public void Awake()
 {
     if (instance == null)
     {
         instance         = this;
         menuInteractions = new ManueInteractions();
         menuInteractions.Menus.Accept.performed += _ => HandleButtonPress(0);
         menuInteractions.Menus.Back.performed   += _ => HandleButtonPress(1);
         menuInteractions.Enable();
     }
     else if (instance != this)
     {
         Debug.Log("Game Manager Instance already defined!");
         Destroy(this);
     }
 }
Exemple #2
0
    public void Awake()
    {
        if (instance == null)
        {
            instance     = this;
            player       = Instantiate(PlayerPrefab, new Vector3(0, 0, 0), Quaternion.identity);
            sound_source = gameObject.AddComponent <AudioSource>();


            menuInteractions = new ManueInteractions();
            menuInteractions.Menus.Accept.performed += _ => HandleButtonPress(0);
            menuInteractions.Menus.Back.performed   += _ => HandleButtonPress(1);
            menuInteractions.Enable();
        }
        else if (instance != this)
        {
            Debug.Log("Game Manager Instance already defined!");
            Destroy(this);
        }
    }