Example #1
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();
    }
Example #2
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();
    }