您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
25 行
622 B
25 行
622 B
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
namespace LobbyRelaySample.inGame
|
|
{
|
|
[RequireComponent(typeof(Rigidbody))]
|
|
public class SymbolContainer : NetworkBehaviour
|
|
{
|
|
public void Start()
|
|
{
|
|
if (IsHost)
|
|
GetComponent<NetworkObject>().Spawn();
|
|
}
|
|
|
|
public override void OnNetworkSpawn()
|
|
{
|
|
if (IsHost)
|
|
{
|
|
Rigidbody m_rb = this.GetComponent<Rigidbody>();
|
|
m_rb.MovePosition(Vector3.up * 10);
|
|
m_rb.velocity = Vector3.down;
|
|
}
|
|
}
|
|
}
|
|
}
|