protected void PlayAmbient() { if (RegionBalance.AmbientSound != null) { Sound_Play ambient = Instantiate(Resources.Load("Sounds/sound_ambient") as GameObject).GetComponent <Sound_Play>(); ambient.Play(RegionBalance.AmbientSound); } }
float speed = 5; //走路速度 // Use this for initialization void Start() { SD = GameObject.Find("players").GetComponent <SpeakData>(); player = this.gameObject; //PD = new PlayerData (); //skipsTimes = 0; //score = 0; //money = 0; states = playerStates.move; SP1 = GameObject.Find("SceneDirector").GetComponent <Sound_Play>(); loadsrc(); ScreenSetting(); }
public static Sound_Play PlaySFX(AudioClip clip, Transform target) { GameObject oneshot_source = GameObject.Instantiate(Resources.Load("Sounds/sfx_oneshot")) as GameObject; Sound_Play play = oneshot_source.GetComponent <Sound_Play>(); oneshot_source.transform.position = target.transform.position; Sequence seq = DOTween.Sequence(); seq.AppendInterval(clip.length); seq.AppendCallback(() => GameObject.Destroy(oneshot_source)); play.Play(clip); return(play); }
public virtual void Init(TurnSystem system) { sound = (Instantiate(Resources.Load("Sounds/sound_crumble")) as GameObject).GetComponent <Sound_Play>(); Instance = this; ActivateTurnSystem(); }
void Start() { SP = GameObject.Find("SceneDirector").GetComponent <Sound_Play>(); }