テストキャラをネットワーク上に生成する



ネットワーク上にキャラを生み出す
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 追加
using Photon.Pun;
public class RoomManager : MonoBehaviourPunCallbacks // ★変更
{
void Start()
{
// テストキャラの生成
// (ポイント1)プレハブ化したデータを「名前」で指定する。
// (ポイント2)プレハブデータは「Resources」という名前のフォルダの中に入れる必要あり。
PhotonNetwork.Instantiate("TestChara", new Vector3(0, 5, 0), Quaternion.identity);
}
}





【2020版】BattleOnline(基礎/全34回)
他のコースを見る


ネットワーク上にキャラを生み出す
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 追加
using Photon.Pun;
public class RoomManager : MonoBehaviourPunCallbacks // ★変更
{
void Start()
{
// テストキャラの生成
// (ポイント1)プレハブ化したデータを「名前」で指定する。
// (ポイント2)プレハブデータは「Resources」という名前のフォルダの中に入れる必要あり。
PhotonNetwork.Instantiate("TestChara", new Vector3(0, 5, 0), Quaternion.identity);
}
}





テストキャラをネットワーク上に生成する