0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PUN2の3 *** Tips ***

Last updated at Posted at 2021-06-03

名前の混同を避ける

    private void Start()
    {
        var nameLabel = GetComponent<TextMesh>();
        if (nameLabel == null) return;
        nameLabel.text = "HOGE";
        //if (photonView == null) return;
        // プレイヤー名とプレイヤーIDを表示する
        nameLabel.text = $"{photonView.Owner.NickName}({photonView.OwnerActorNr})";
    }

PhotonViewの取得

        PhotonView photonView = PunExtensions.GetPhotonView(obj);
        photonView.Owner.NickName = "tiger";

VPAD

public class VPAD : MonoBehaviour
{
    public FixedJoystick joystick;
    public ButtonState buttonA;
    public ButtonState buttonB;
    GameObject m_self;
    void Update()
    {
        Vector3 t_pos = Vector3.zero;
        var sc = this.GetComponent<ExitGames.Demos.DemoPunVoice.CharacterInstantiation>();
        if (sc) m_self = sc.m_self;

        if (m_self == null) return;
        float val = 0.02f;
        if (joystick.Horizontal > 0.5f)
        {
            t_pos.x = val;
        }
        if (joystick.Horizontal < -0.5f)
        {
            t_pos.x = -val;
        }
        if (joystick.Vertical > 0.5f)
        {
            t_pos.z = val;
        }
        if (joystick.Vertical < -0.5f)
        {
            t_pos.z = -val;
        }

        m_self.transform.position += t_pos;
    }
}

ハウリング

PUN生成するOBJにSpeakerつけるとハウリングノイズがなくなる(ような気がする)
image.png

Recorderマイクタイプ

image.png

Recorder.MicrophoneType Unity or Photon デフォルトは[Unity] 
Phothonの場合は次のコードでリストアップできる。

‘‘‘
var enumerator = Recorder.PhotonMicrophoneEnumerator;
if (enumerator.IsSupported)
{
for (int i = 0; i < enumerator.Count; i++)
{
Debug.LogFormat("PhotonMicrophone Index={0} ID={1} Name={2}", i, enumerator.IDAtIndex(i),
enumerator.NameAtIndex(i));
}
}
‘‘‘

Recorder.VoiceDetectionThreshold

VoiceDetectionThresholdのデフォルト値は0,01です。 これは、ボイス検出キャリブレーションとノイズレベル測定を使った実験の結果として、一般的な環境に推奨される値です。

AudioSource

3D Sound Settings
MinDistance
MaxDistance

image.png

インタレストグループ Recorder.InterestGroup

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?