Version: 2021.1

MonoBehaviour.OnServerInitialized()

切换到手册

描述

每当调用 Network.InitializeServer 并且完成时,对该服务器调用该函数。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnServerInitialized() { Debug.Log("Server initialized and ready"); } }