Пример #1
0
 public CocoPieceBuilder()
 {
     this.settings = DependencyService.Get<ISetttingsProvider>(DependencyFetchTarget.GlobalInstance);
     this.cache = CCSpriteFrameCache.SharedSpriteFrameCache;
     var set = settings["chess-set"];
     var chessSet = JsonConvert.DeserializeObject<ChessSet>(set);
     if (chessSet != null && !string.IsNullOrEmpty(chessSet.FilePath))
     {
         this.cache.AddSpriteFrames(chessSet.FilePath);
     }
     else
     {
         // default value
         this.cache.AddSpriteFrames("hd/sprites.plist");
     }
 }
Пример #2
0
        public CocoPieceBuilder()
        {
            this.settings = DependencyService.Get <ISetttingsProvider>(DependencyFetchTarget.GlobalInstance);
            this.cache    = CCSpriteFrameCache.SharedSpriteFrameCache;
            var set      = settings["chess-set"];
            var chessSet = JsonConvert.DeserializeObject <ChessSet>(set);

            if (chessSet != null && !string.IsNullOrEmpty(chessSet.FilePath))
            {
                this.cache.AddSpriteFrames(chessSet.FilePath);
            }
            else
            {
                // default value
                this.cache.AddSpriteFrames("hd/sprites.plist");
            }
        }