This commit is contained in:
Karrar
2024-03-27 22:26:13 +03:00
commit 0caf47a728
223 changed files with 32253 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using UnityEngine;
using Netick;
using Netick.Unity;
namespace Netick.Samples.Bomberman
{
public class Block : NetworkBehaviour
{
// Networked properties
[Networked]
public bool Visible { get; set; } = true;
[OnChanged(nameof(Visible))]
private void OnVisibleChanged(OnChangedData onChangedData)
{
// for visual components, don't use "enabled" property when you want to disable/enable it, instead use SetEnabled().
// -- GetComponent<Renderer>().enabled = Visible; #### Not like this.
GetComponent<Renderer>().SetEnabled(Sandbox, Visible); // #### Like this.
GetComponent<BoxCollider>().enabled = Visible;
}
}
}