Ejemplo n.º 1
0
    public void announce_unlock(CharacterIndex aChar, UnlockRequirements.UnlockData aData)
    {
        float gDisplayTime = 5;

        FlatUnlockBadge badge = new FlatUnlockBadge(aChar, aData, 30);

        badge.HardPosition = mSunset.mFlatCamera.get_point(Vector3.zero) + new Vector3(0, 2000, 0);
        badge.SoftPosition = mSunset.mFlatCamera.get_point(Vector3.zero);
        mElement.Add(badge);

        TED.add_one_shot_event(
            delegate() {
            badge.SoftPosition = badge.SoftPosition + new Vector3(0, -2000, 0);
        }
            , gDisplayTime).then_one_shot(
            delegate(){
            mElement.Remove(badge);
            badge.destroy();
        }
            , 1.5f);
    }
Ejemplo n.º 2
0
    public FlatUnlockBadge(CharacterIndex aChar, UnlockRequirements.UnlockData aData, int aDepth)
    {
        var unlockfont = ManagerManager.Manager.mNewRef.serifFont;
        var bgImage    = ManagerManager.Manager.mCharacterBundleManager.get_image("UNLOCKABLES_PLATE");

        background = new FlatElementImage(bgImage.Image, bgImage.Data.Size, aDepth);
        text1      = new FlatElementText(unlockfont, 120, "new lifestyle", aDepth + 1);
        text2      = new FlatElementText(unlockfont, 200, "UNLOCKED", aDepth + 1);
        mainIcon   = new FlatUnlockIcon(aChar, true, aDepth + 1);

        if (aData.Related.Length == 0)
        {
            text3 = new FlatElementText(unlockfont, 200, FlatElementText.convert_to_multiline_max(35, aData.Sentence), aDepth + 1);
        }
        else
        {
            text3 = new FlatElementText(unlockfont, 70, FlatElementText.convert_to_multiline_max(35, aData.Sentence), aDepth + 1);
        }

        mElements.Add(new FlatElementMultiBase.ElementOffset(background, new Vector3(0, 0, 0)));
        mElements.Add(new FlatElementMultiBase.ElementOffset(text1, new Vector3(0, 600, 0)));
        mElements.Add(new FlatElementMultiBase.ElementOffset(text2, new Vector3(0, 450, 0)));
        mElements.Add(new FlatElementMultiBase.ElementOffset(mainIcon, new Vector3(0, 125, 0)));
        mElements.Add(new FlatElementMultiBase.ElementOffset(text3, new Vector3(0, -200, 0)));

        contributors = new FlatUnlockIcon[aData.Related.Length];
        Vector3 step  = new Vector3(-400, 0, 0);
        Vector3 start = (contributors.Length - 1) * (-step) / 2f + new Vector3(0, -700, 0);

        for (int i = 0; i < contributors.Length; i++)
        {
            contributors[i] = new FlatUnlockIcon(aData.Related[i], false, aDepth + 1);
            FlatUnlockIcon e = contributors[i];
            mElements.Add(new FlatElementMultiBase.ElementOffset(e, start + step * i));
        }

        PrimaryGameObject = create_primary_from_elements();
        Depth             = aDepth;
    }
Ejemplo n.º 3
0
 public void unlock(CharacterIndex aIndex, UnlockRequirements.UnlockData aData)
 {
     mUnlocked.unlockedCharacters[aIndex] = 1;
     unlockedThisGame[new UnlockRequirements.FakeCharIndex(aIndex)] = aData;
 }