Skip to content

Instantly share code, notes, and snippets.

@soyliquid
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soyliquid/9042fcebf4e7dce14153 to your computer and use it in GitHub Desktop.
Save soyliquid/9042fcebf4e7dce14153 to your computer and use it in GitHub Desktop.
[Unity][Photon]RPCを使って全クライアントで足音を鳴らす
using UnityEngine;
using System.Collections;
public class FootStepManager : Photon.MonoBehaviour {
public AudioSource SoundPosition;
void FootStep() {
Debug.Log("FootStep " + SoundManager.Instance.FootStepSE.name);
photonView.RPC("PlayFootStepSound", PhotonTargets.All);
}
[RPC]
void PlayFootStepSound() {
SoundPosition.PlayOneShot(SoundManager.Instance.FootStepSE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment