コード例 #1
0
ファイル: WeaponHook.cs プロジェクト: arkii1/Heist
        public void Init(AudioHolder _shootingAudio, AudioHolder _reloadingAudio)
        {
            shootingAudio  = _shootingAudio;
            reloadingAudio = _reloadingAudio;

            GameObject go = new GameObject();

            go.name                   = "Audio Holder";
            go.transform.parent       = bulletSpawnPoint.transform;
            audioSource1              = go.AddComponent <AudioSource>();
            audioSource1.playOnAwake  = false;
            audioSource2              = go.AddComponent <AudioSource>();
            audioSource2.playOnAwake  = false;
            audioSource1.spatialBlend = 1;
            audioSource2.spatialBlend = 1;

            particles = GetComponentsInChildren <ParticleSystem>();
        }