Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Networking;
- using System.Collections;
- public class AudioSync : NetworkBehaviour
- {
- public AudioController audioController;
- // Use this for initialization
- void Start()
- {
- audioController = GetComponent<AudioController>();
- }
- public void syncSound(int id)
- {
- CmdSendServerSound(id);
- }
- [Command]
- void CmdSendServerSound(int id)
- {
- RPCSendSoundToClients(id);
- }
- [ClientRpc]
- void RPCSendSoundToClients(int id)
- {
- audioController.steps.Play();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement