private void onAddTarget(ITarget target)
        {
            BaseTargetView item = pool.GetNewView(prefabView, spawnRoot);
            RectTransform  rect = spawnRoot.GetComponent <RectTransform>();

            item.transform.SetParent(spawnRoot);
            item.InitTargetView(target, locator.transform, rect);
            Targets.Add(item);
        }
        public BaseTargetView GetNewView(BaseTargetView prefabView, Transform spawnRoot)
        {
            BaseTargetView view;

            if (poolTargetViews.Count <= 0)
            {
                view = Instantiate(prefabView, spawnRoot);
            }
            else
            {
                view = poolTargetViews[poolTargetViews.Count - 1];
                poolTargetViews.Remove(view);
                view.gameObject.SetActive(true);
            }
            return(view);
        }
 public void SetToPool(BaseTargetView view)
 {
     view.gameObject.SetActive(false);
     poolTargetViews.Add(view);
 }
        private void onRemoveTarget(ITarget target)
        {
            BaseTargetView item = Targets.Find(x => x.CurrentTarget.GetHashCode() == target.GetHashCode());

            pool.SetToPool(item);
        }