コード例 #1
0
 public void InitializePiece(LandContent lc)
 {
     cardPortrait   = lc.cardPortrait;
     name           = lc.name;
     flavor         = lc.flavor;
     gameProperties = lc.gameProperties;
 }
コード例 #2
0
        public LandContent RandomLand()
        {
            LandContent randomLand = null;

            if (landContentList.Count > 0)
            {
                randomLand = landContentList[Random.Range(0, landContentList.Count)];
                if (randomLand.isUnique)
                {
                    landContentList.Remove(randomLand);
                }
            }

            return(randomLand);
        }
コード例 #3
0
ファイル: ActionSpawnLand.cs プロジェクト: BrandedTales/Brume
        public override void Execute(GameData data)
        {
            landContent = landIndex.RandomLand();
            if (landContent != null)
            {
                CardInstance newCard = Instantiate(cardPrefab);
                newCard.transform.SetParent(GameObject.Find("LandPanel").transform);  //Don't like this hard reference.
                newCard.name        = landContent.name;
                newCard.isDraggable = false;

                var land = ScriptableObject.CreateInstance <Land>();
                land.isRevealed = false;
                land.isActive   = false;
                land.InitializePiece(landContent);

                landList.Add(land);
                newCard.GetComponent <CardInstance>().pieceDetails = land;
            }
        }