IEnumerator SendToStorage ( TempResourceButton button) { yield return new WaitForSeconds(timeToMoveToCollected); button.transform.SetParent ( storageTransform ); resourceList.Add(button); button.GetComponent<Button>().interactable = true; button.myState = TempResourceButton.ResourceState.Collected; }
public void HandleButtonClick ( TempResourceButton button ) { if ( button.myState == TempResourceButton.ResourceState.Spawned) { button.GetComponent<Button>().interactable = false; spawnedList.Remove(button); StartCoroutine(SendToStorage(button)); } else { currentResource = button; } }