예제 #1
0
    public static GameSummary Create(RectTransform parent, GameManager.Save data)
    {
        GameObject  pref    = ABU.LoadAsset <GameObject> ("core", "GameSummary");
        GameObject  inst    = Instantiate <GameObject> (pref, parent, false);
        GameSummary summary = inst.GetComponent <GameSummary> ();

        summary.SetName(data.gameName);
        summary.SetDifficulty(data.difficulty);
        summary.SetTime(data.gameTime);
        summary.SetArea(data.currScene);

        for (int i = 0; i < summary.damageTypes.Length; i++)
        {
            if ((data.dtUnlocks & (1 << (i + 1))) == 0)
            {
                summary.damageTypes [i].color = Color.clear;
            }
        }

        for (int i = 0; i < summary.abilities.Length; i++)
        {
            if ((data.abilities & (1 << i)) == 0)
            {
                summary.abilities [i].color = Color.clear;
            }
        }

        summary.data = data;

        return(summary);
    }