IEnumerator PlatformCollectibleEnumerator(PlatformTypeChance.PlatformType type, float value) { for (int i = 0; i < platformFactory.transform.childCount; i++) { GameObject child = platformFactory.transform.GetChild(i).gameObject; int objectLayer = 1 << child.layer; if (1 << child.layer == landMask.value) { Platform p = child.GetComponent <Platform>(); switch (type) { default: p.AddPlatformComponent(type); break; case PlatformTypeChance.PlatformType.Resizeable: p.StartResizeAnimation(value); break; } } yield return(null); } }
void AddPlatformCollectible(PlatformTypeChance.PlatformType type, float value) { _collectiblePlatformManager.AddCollectible(type, value); StartCoroutine(PlatformCollectibleEnumerator(type, value)); }
public void AddPlatformComponent(PlatformTypeChance.PlatformType type) { _platformToAdd = type; _addPlatformComponent = true; }