1 using UnityEngine;
2 using
System.Collections;
3
4 public
class SavePoint2 : MonoBehaviour
5 {
6     
public AudioClip soundFx;
7     AudioSource soundController;
8
9     
public static bool saved2 = false;
10
11     
// Use this for initialization
12     
void Start()
13     {
14         soundController = GetComponent<AudioSource>();
15     }
16
17     
// Update is called once per frame
18     
void Update()
19     {
20
21     }
22
23
24     
void OnTriggerEnter(Collider target)
25     {
26         
if (target.gameObject.name == "Player")
27         {
28             saved2 =
true;
29             soundController.PlayOneShot(soundFx,
1);
30         }
31     }
32     
33 }


Gõ tìm kiếm nhanh...