コード例 #1
0
        private void Awake()
        {
            data = ShopMenuData.GetShopMenu();

            //check if unlock data exists
            if (SaveManager.savaData.UnlockedCharacters == null)
            {
                SaveManager.savaData.UnlockedCharacters = new bool[0];
            }

            if (SaveManager.savaData.UnlockedBackgrounds == null)
            {
                SaveManager.savaData.UnlockedBackgrounds = new bool[0];
            }

            //check if lenght is the same as the number of characters
            if (SaveManager.savaData.UnlockedCharacters.Length != data.Characters.Length)
            {
                SaveManager.savaData.UnlockedCharacters = (bool[])Util.Common.ResizeArray(SaveManager.savaData.UnlockedCharacters, new int[] { data.Characters.Length });
            }

            if (SaveManager.savaData.UnlockedBackgrounds.Length != data.Backgrounds.Length)
            {
                SaveManager.savaData.UnlockedBackgrounds = (bool[])Util.Common.ResizeArray(SaveManager.savaData.UnlockedBackgrounds, new int[] { data.Backgrounds.Length });
            }

            InitCharacters();
            InitBackgrounds();

            UpdateDisplayList(Characters, SaveManager.savaData.SelectedCharacter);
            UpdateDisplayList(Backgrounds, SaveManager.savaData.SelectedBackground);

            PrefabDisplayObject.SetActive(false);
        }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        Menus.ShopMenuData data = Menus.ShopMenuData.GetShopMenu();

        BackgroundObj.sprite = data.Backgrounds[SaveManager.savaData.SelectedBackground].HighRes;

        Common.ScaleSpriteToFitScreen(BackgroundObj, true);
    }