private void refreshOverview() { overviewListRemoveObjects(); GameObject[] objectsInSpace = GameObject.FindGameObjectsWithTag("ObjectInSpace"); ObjectInSpace checkedSpaceObject = null; bool notOwner = true; bool canBeTargetted = true; bool inNotOnList = true; bool isInRange = true; for (int i = 0; i < objectsInSpace.Length; i++) { notOwner = false; canBeTargetted = false; inNotOnList = false; isInRange = false; checkedSpaceObject = (ObjectInSpace)objectsInSpace[i].GetComponent <ObjectInSpace>(); if (checkedSpaceObject) { notOwner = (owner.GetInstanceID() != checkedSpaceObject.GetInstanceID()); canBeTargetted = checkedSpaceObject.getCanBeTargetted(); inNotOnList = !isThisObjectOnOverviewList(checkedSpaceObject); isInRange = owner.isInTargettingRange(checkedSpaceObject); if (notOwner && canBeTargetted && inNotOnList && isInRange) { addOverviewItemToOverview(checkedSpaceObject); } } } }