using System.Collections.Generic; using Framework; using UnityEngine; namespace Gameplay.Unit.Data { public class UnitViewData { public GameUnit owner; public bool isShow; private GameObject _activeObj; public UnitViewData(GameUnit owner) { this.owner = owner; _SetActiveObj(); isShow = true; } private void _SetActiveObj() { switch (owner.gameunitType) { case EGameUnitType.Character: _activeObj = owner.Node.GameObject.transform.GetChild(0).GetChild(1).gameObject; break; case EGameUnitType.Vehicle: _activeObj = owner.Node.GameObject.transform.GetChild(0).gameObject; break; default: _activeObj = owner.Node.GameObject.transform.GetChild(0).gameObject; break; } } public void SetShow(bool setShow) { if (isShow == setShow) return; isShow = setShow; EventManager.Instance.Send(EventManager.EventName.INFIGHT_UNIT_VISIBLE_CHANGE, owner); _activeObj.SetActive(isShow); } } }