예제 #1
0
    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);
        }
    }
예제 #2
0
 void AddPlatformCollectible(PlatformTypeChance.PlatformType type, float value)
 {
     _collectiblePlatformManager.AddCollectible(type, value);
     StartCoroutine(PlatformCollectibleEnumerator(type, value));
 }
예제 #3
0
 public void AddPlatformComponent(PlatformTypeChance.PlatformType type)
 {
     _platformToAdd        = type;
     _addPlatformComponent = true;
 }