35 lines
642 B
C#
35 lines
642 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DragonLi.Core;
|
|
using Mirror;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class Door : NetworkBehaviour
|
|
{
|
|
public List<GameObject> gameObjects;
|
|
|
|
public void Start()
|
|
{
|
|
if (isServer)
|
|
{
|
|
RpcSetActive();
|
|
}
|
|
}
|
|
|
|
[ClientRpc]
|
|
public void RpcSetActive()
|
|
{
|
|
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
|
{
|
|
if (gameObjects.Count == 0) return;
|
|
for (int i = 0; i < gameObjects.Count; i++)
|
|
{
|
|
gameObjects[i].SetActive(false);
|
|
}
|
|
}, 1.3f);
|
|
}
|
|
|
|
|
|
}
|