public void OnEvaluateClicked() { if (!HasArguments) { EvaluateAndSetCell(); } else { if (Evaluator == null) { this.Evaluator = Pool <EvaluateWidget> .Borrow(); Evaluator.OnBorrowedFromPool(this); Evaluator.UIRoot.transform.SetParent((CellView as CacheMemberCell).EvaluateHolder.transform, false); SetCellEvaluateState(CellView); } else { if (Evaluator.UIRoot.activeSelf) { Evaluator.UIRoot.SetActive(false); } else { Evaluator.UIRoot.SetActive(true); } SetCellEvaluateState(CellView); } } }
public override void ReleasePooledObjects() { base.ReleasePooledObjects(); if (this.Evaluator != null) { this.Evaluator.OnReturnToPool(); Pool <EvaluateWidget> .Return(this.Evaluator); this.Evaluator = null; } }