Last active
August 29, 2015 14:10
-
-
Save soyliquid/9042fcebf4e7dce14153 to your computer and use it in GitHub Desktop.
[Unity][Photon]RPCを使って全クライアントで足音を鳴らす
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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