Наследование: MonoBehaviour
Пример #1
0
 public static void DestroyMenuSound()
 {
     if (instance != null)
     {
         Destroy(instance.gameObject);
         instance = null;
     }
 }
Пример #2
0
    private void Awake()
    {
        sound = GetComponent <MenuSound>();
        SetScaleToZero(menuButtons);
        SetScaleToZero(title);
        SetScaleToZero(credits);

        StartCoroutine("StartAnimation");
    }
Пример #3
0
        public bool Play(MenuSound sound)
        {
            if (sounds.TryGetValue(sound, out SoundEffect sfx))
            {
                return(sfx.Play());
            }

            return(false);
        }
Пример #4
0
	void Awake() {
		if (instance != null && instance != this) {
			Destroy (this.gameObject);
			return;
		} else {
			instance = this;
		}

		DontDestroyOnLoad (this.gameObject);
	}
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        _rb = GetComponent <Rigidbody>();
        cam = Camera.main;
        my  = GetComponent <Transform>();

        _lifepts = 5; //NB de points de vie du joueur

        _menuSound = FindObjectOfType <MenuSound>();
        _audM      = FindObjectOfType <AudioManager>();
    }
Пример #6
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #7
0
 void Awake()
 {
     if (menuSound == null)
     {
         DontDestroyOnLoad(gameObject);
         menuSound = this;
     }
     else if (menuSound != this)
     {
         Destroy(gameObject);
     }
 }
Пример #8
0
    void Awake()
    {
        if (MenuSound.menuSound != null && MenuSound.menuSound != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            MenuSound.menuSound = this;
        }

        DontDestroyOnLoad(MenuSound.menuSound.gameObject);
    }
Пример #9
0
    // Start is called before the first frame update
    void Start()
    {
        _speed  = 2.0f;
        _life   = 3;
        _player = GameObject.FindWithTag("Player");
        p1      = GameObject.Find("Player").GetComponent <Player>();
        cA      = GameObject.Find("Ground").GetComponent <CleanArea>();

        _menuSound = FindObjectOfType <MenuSound>();
        _audM      = FindObjectOfType <AudioManager>();

        _audM._Spawn.clip = _menuSound._clips[5];
        _audM._Spawn.Play();
    }
Пример #10
0
    // Start is called before the first frame update
    void Start()
    {
        _sp        = GameObject.Find("GameManager").GetComponent <Spawner>();
        m_Material = GetComponent <Renderer>().material;
        e_Deaths   = 0;

        _N1.SetActive(true);
        _N2.SetActive(false);

        _menuSound = FindObjectOfType <MenuSound>();
        _audM      = FindObjectOfType <AudioManager>();

        //_zC.gameObject.SetActive(false);
    }
Пример #11
0
    void Start()
    {
        instance = this;
        DontDestroyOnLoad(gameObject);

        asource = GetComponent <AudioSource> ();

        if (PreLoader.Instance.musicState)
        {
            asource.enabled = true;
        }
        else
        {
            asource.enabled = false;
        }
    }
Пример #12
0
    //public AudioSource _audioSource;


    // Start is called before the first frame update
    void Start()
    {
        _menuSound = FindObjectOfType <MenuSound>();
        _audM      = FindObjectOfType <AudioManager>();
        //_audioSource = Camera.main.GetComponent<AudioSource>();

        _speed  = 2.0f;
        _player = GameObject.FindWithTag("Player");
        _life   = 6;
        cA      = GameObject.Find("Ground").GetComponent <CleanArea>();
        _rb     = GetComponent <Rigidbody>();
        //_source = //GameObject.Find("AudioManager").GetComponent<AudioSource>();
        //_clips = GameObject.Find("AudioManager").GetComponent<AudioClip>()._clips;

        //_source.Play(_clips[7]);
        _audM._Spawn.clip = _menuSound._clips[5];
        _audM._Spawn.Play();

        StartCoroutine("ShootBehave1");
        StartCoroutine("AwayOfSpawn");

        //_audioSource.clip = _menuSound._clips[5];
        //_audioSource.Play();
    }
Пример #13
0
	public void turnMusicOff() {
		if (instance != null) {
			Destroy (this.gameObject);
			instance = null;
		}
	}
Пример #14
0
	void OnApplicationQuit() {
		instance = null;
	}
Пример #15
0
 private void Start()
 {
     MenuSound.DestroyMenuSound();
 }
Пример #16
0
 private void Awake()
 {
     sound = GetComponent <MenuSound>();
     areYouSure.SetActive(false);
 }
Пример #17
0
 void Awake()
 {
     sm = gameObject.GetComponent <MenuSound> ();
 }
Пример #18
0
 private void Awake()
 {
     sound = controller.GetComponent <MenuSound>();
 }
Пример #19
0
 private void Awake()
 {
     sound = GetComponent <MenuSound>();
 }