Exemplo n.º 1
0
    public void SetCollect(CollectableBonus collectableBonus)
    {
        int id = -1;

        for (int i = 0; i < collectableBonuses.Length; i++)
        {
            if (collectableBonuses[i] == collectableBonus)
            {
                id = i;
            }
        }

        if (id > -1)
        {
            collectedStates[id] = true;

            BonusCollectableList.WorldList worldList = BonusCollectableList.GetWorldList(GameplayData.currentWorld);
            BonusCollectableList.StageList stageList = BonusCollectableList.GetCurrentStageList(worldList);

            if (!stageList.collectableStates[id])
            {
                BonusCollectableDisplay.instance.AddValue(1);
            }
            else
            {
                BonusCollectableDisplay.instance.AddValue(0);
            }
        }
    }
Exemplo n.º 2
0
    public void Setup()
    {
        WorldData worldData = GameplayData.GetWorldData(worldID);

        int bonusCount = BonusCollectableList.GetWorldCollectedCount(worldID);

        moonCountDisplay.text = bonusCount.ToString() + "/" + worldData.moonMax.ToString();

        collectableCountDisplay.text = "x" + worldData.collectCount;
    }
Exemplo n.º 3
0
    public static void SaveCollectedStates()
    {
        BonusCollectableList.WorldList worldList = BonusCollectableList.GetWorldList(GameplayData.currentWorld);
        BonusCollectableList.StageList stageList = BonusCollectableList.GetCurrentStageList(worldList);

        for (int i = 0; i < collectedStates.Length; i++)
        {
            if (collectedStates[i])
            {
                stageList.collectableStates[i] = true;
            }
        }
    }
Exemplo n.º 4
0
    private void InitCollectables(int childCount)
    {
        collectableBonuses = new CollectableBonus[childCount];
        collectedStates    = new bool[childCount];

        for (int i = 0; i < childCount; i++)
        {
            collectableBonuses[i] = transform.GetChild(i).GetComponent <CollectableBonus>();
            collectableBonuses[i].Init(this);
        }

        BonusCollectableList.WorldList worldList = BonusCollectableList.GetWorldList(GameplayData.currentWorld);
        BonusCollectableList.StageList stageList = BonusCollectableList.GetCurrentStageList(worldList);

        int count;

        if ((count = stageList.collectableStates.Count) < 1)
        {
            //cria a lista em que todos os coletáveis locais não estão coletados
            for (int i = 0; i < childCount; i++)
            {
                stageList.collectableStates.Add(false);
            }
        }
        else
        {
            //fade out nos coletáveis já coletados
            for (int i = 0; i < count; i++)
            {
                if (stageList.collectableStates[i])
                {
                    collectableBonuses[i].FadeOutSprite();
                }
            }
        }
    }
Exemplo n.º 5
0
 private void Start()
 {
     tabAnchor.anchoredPosition = Vector2.right * HIDDEN_X;
     score = BonusCollectableList.GetWorldCollectedCount(GameplayData.currentWorld);
     UpdateDisplay();
 }