Version: 2023.2

MonoBehaviour.OnConnectedToServer()

切换到手册

描述

成功连接到服务器后在客户端上调用。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnConnectedToServer() { Debug.Log("Connected to server"); // Send local player name to server ... } }