public void ApplyQuery() { _element = ElementLibrary.SelectGoodElement(_GoodElementCondition); GameObject[] gObjects = GameObject.FindGameObjectsWithTag("Element"); Vector3 position; Quaternion rotation; foreach (GameObject g in gObjects) { if (_Condition.IsVerifyingConditions(g.GetComponent <ElementsProperties>())) { position = g.transform.position; rotation = g.transform.rotation; Destroy(g); Instantiate(_element, position, rotation); } } }
public void ApplyQuery() { _element = ElementLibrary.SelectGoodElement(_GoodElementCondition); gameObject.GetComponent <SpawnElements>().SpawnElement(_element, SpawnDuration); }