Exemplo n.º 1
0
    // Copy sprites from the database into a HeroSprite instance
    // Called during creation of a BattleHero
    public static HeroSprites MakeNewHeroSprites(HeroType type)
    {
        switch (type)
        {
        case HeroType.Sabin:
            SabinSprites sabinSprites = new SabinSprites();
            sabinSprites = (SabinSprites)Copy(HeroType.Sabin, sabinSprites);
            return(sabinSprites);

        case HeroType.Locke:
            LockeSprites lockeSprites = new LockeSprites();
            lockeSprites = (LockeSprites)Copy(HeroType.Locke, lockeSprites);
            return(lockeSprites);

        case HeroType.Edgar:
            EdgarSprites edgarSprites = new EdgarSprites();
            edgarSprites = (EdgarSprites)Copy(HeroType.Edgar, edgarSprites);
            return(edgarSprites);

        case HeroType.Celes:
            CelesSprites celesSprites = new CelesSprites();
            celesSprites = (CelesSprites)Copy(HeroType.Celes, celesSprites);
            return(celesSprites);

        default:
            sabinSprites = new SabinSprites();
            sabinSprites = (SabinSprites)Copy(HeroType.Sabin, sabinSprites);
            return(sabinSprites);
        }
    }
Exemplo n.º 2
0
    // Build a database for each hero, then add the database to the 'data' container
    static void BuildSpriteDatabase()
    {
        // sabin generics
        SabinSprites sabinSprites = new SabinSprites();

        BuildGeneric(HeroType.Sabin, sabinSprites);

        // sabin uniques
        sabinSprites.Kick      = Resources.Load <Sprite>(@"Sprites\Hero\" + HeroType.Sabin.ToString() + Stance.Kick.ToString());
        sabinSprites.AuraBolt  = sabinSprites.Cast[0];
        sabinSprites.FireDance = Resources.Load <Sprite>(@"Sprites\Hero\" + HeroType.Sabin.ToString()
                                                         + Stance.FireDance.ToString());

        // add sabin database
        data.Add(HeroType.Sabin, sabinSprites);


        // celes generics
        CelesSprites celesSprites = new CelesSprites();

        BuildGeneric(HeroType.Celes, celesSprites);

        // celes unique
        string prefix = @"Sprites\Hero\" + HeroType.Celes.ToString() + Stance.RunicBlade.ToString();

        for (int i = 0; i <= 6; i++)
        {
            celesSprites.RunicBlade[i] = Resources.Load <Sprite>(prefix + i);
        }

        // add celes database
        data.Add(HeroType.Celes, celesSprites);


        // edgar generics
        EdgarSprites edgarSprites = new EdgarSprites();

        BuildGeneric(HeroType.Edgar, edgarSprites);

        // add edgar database
        data.Add(HeroType.Edgar, edgarSprites);


        // locke generics
        LockeSprites lockeSprites = new LockeSprites();

        BuildGeneric(HeroType.Locke, lockeSprites);

        // add locke database
        data.Add(HeroType.Locke, lockeSprites);
    }