using FishNet.Object;
using UnityEngine;
using IStalk.Eye;

namespace IStalk.Runner
{
    public class RunnerVisibility : NetworkBehaviour
    {
        [SerializeField] private Renderer[] _renderers;

        private RunnerController _runner;

        public override void OnStartServer()
        {
            base.OnStartServer();
            _runner = GetComponent<RunnerController>();
            if (LoSManager.Instance != null)
                LoSManager.Instance.RegisterRunner(_runner);
        }

        public override void OnStopServer()
        {
            base.OnStopServer();
            if (LoSManager.Instance != null && _runner != null)
                LoSManager.Instance.UnregisterRunner(_runner);
        }
    }
}
