public override bool InstantExecute(GameObject target, IAction[] actions, int index) { Transform originTransform = this.origin.GetTransform(target); if (originTransform == null) { return(true); } Collider[] colliders = this.GatherColliders(target); List <GameObject> array = new List <GameObject>(); string compareTag = this.withTag.GetValue(target); for (int i = 0; i < colliders.Length; ++i) { if (colliders[i].gameObject.CompareTag(compareTag)) { array.Add(colliders[i].gameObject); } } array.Sort((x, y) => { float distanceX = Vector3.Distance(originTransform.position, x.transform.position); float distanceY = Vector3.Distance(originTransform.position, y.transform.position); return(distanceX.CompareTo(distanceY)); }); ListVariables list = this.listVariables.GetListVariables(target); VariablesManager.ListClear(list); foreach (GameObject element in array) { VariablesManager.ListPush(list, ListVariables.Position.Last, element); } return(true); }