30 lines
557 B
C#
30 lines
557 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Mirror;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.Serialization;
|
|
|
|
public class Unit : NetworkBehaviour
|
|
{
|
|
[SerializeField] private UnityEvent _onSelect;
|
|
[SerializeField] private UnityEvent _onDeSelect;
|
|
|
|
#region Client
|
|
|
|
[Client]
|
|
public void Select()
|
|
{
|
|
if (!isOwned) return;
|
|
_onSelect?.Invoke();
|
|
}
|
|
|
|
[Client]
|
|
public void DeSelect()
|
|
{
|
|
if (!isOwned) return;
|
|
_onDeSelect?.Invoke();
|
|
}
|
|
|
|
#endregion
|
|
} |