@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: c0b7ece12d08c994c8148e8c99779e95 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 00413532d565759498ce9f44318f10c8 |
||||
|
folderAsset: yes |
||||
|
DefaultImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,77 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!1 &7923840369743001728 |
||||
|
GameObject: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
serializedVersion: 6 |
||||
|
m_Component: |
||||
|
- component: {fileID: 1697361232407890054} |
||||
|
- component: {fileID: 1550482915104832439} |
||||
|
- component: {fileID: 9161029464335761816} |
||||
|
m_Layer: 5 |
||||
|
m_Name: CardSlot |
||||
|
m_TagString: Untagged |
||||
|
m_Icon: {fileID: 0} |
||||
|
m_NavMeshLayer: 0 |
||||
|
m_StaticEditorFlags: 0 |
||||
|
m_IsActive: 1 |
||||
|
--- !u!224 &1697361232407890054 |
||||
|
RectTransform: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 7923840369743001728} |
||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
||||
|
m_LocalPosition: {x: 0, y: 0, z: 0} |
||||
|
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} |
||||
|
m_ConstrainProportionsScale: 1 |
||||
|
m_Children: [] |
||||
|
m_Father: {fileID: 0} |
||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
||||
|
m_AnchorMin: {x: 0, y: 0} |
||||
|
m_AnchorMax: {x: 0, y: 0} |
||||
|
m_AnchoredPosition: {x: 0, y: 0} |
||||
|
m_SizeDelta: {x: 0, y: 0} |
||||
|
m_Pivot: {x: 0.5, y: 0.5} |
||||
|
--- !u!222 &1550482915104832439 |
||||
|
CanvasRenderer: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 7923840369743001728} |
||||
|
m_CullTransparentMesh: 1 |
||||
|
--- !u!114 &9161029464335761816 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 7923840369743001728} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} |
||||
|
m_Name: |
||||
|
m_EditorClassIdentifier: |
||||
|
m_Material: {fileID: 0} |
||||
|
m_Color: {r: 0.8867924, g: 0.8867924, b: 0.8867924, a: 1} |
||||
|
m_RaycastTarget: 1 |
||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
||||
|
m_Maskable: 1 |
||||
|
m_OnCullStateChanged: |
||||
|
m_PersistentCalls: |
||||
|
m_Calls: [] |
||||
|
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} |
||||
|
m_Type: 1 |
||||
|
m_PreserveAspect: 0 |
||||
|
m_FillCenter: 1 |
||||
|
m_FillMethod: 4 |
||||
|
m_FillAmount: 1 |
||||
|
m_FillClockwise: 1 |
||||
|
m_FillOrigin: 0 |
||||
|
m_UseSpriteMesh: 0 |
||||
|
m_PixelsPerUnitMultiplier: 1 |
||||
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 04fb9628a5a2dff4da117f5d5f865ae7 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
|
Before Width: | Height: | Size: 753 KiB After Width: | Height: | Size: 676 KiB |
|
Before Width: | Height: | Size: 753 KiB After Width: | Height: | Size: 753 KiB |
|
Before Width: | Height: | Size: 753 KiB After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 753 KiB |
|
Before Width: | Height: | Size: 676 KiB |
@ -1,115 +0,0 @@ |
|||||
using System.Collections; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Text; |
|
||||
using UnityEngine; |
|
||||
using UnityEngine.UI; |
|
||||
|
|
||||
public class CardDataForChooseUI : MonoBehaviour |
|
||||
{ |
|
||||
public CardOriginalData cardOriginalData; |
|
||||
public HashSet<MapUnity> influencePreviewPool = new HashSet<MapUnity>();//卡牌的影响范围
|
|
||||
|
|
||||
public string cardId; |
|
||||
|
|
||||
public Text cost; |
|
||||
public string CardId |
|
||||
{ |
|
||||
get { return cardId; } |
|
||||
set { cardId = value; } |
|
||||
} |
|
||||
|
|
||||
public int cardIndex; |
|
||||
|
|
||||
public Text cardDescription; |
|
||||
public Text cardName; |
|
||||
|
|
||||
public Image cardImage; |
|
||||
|
|
||||
public bool costEnough = true; |
|
||||
[Header("奖励选卡控件")] |
|
||||
public GameObject currentRewardCardTip; |
|
||||
|
|
||||
[Header("商店选卡控件")] |
|
||||
public bool canSale =true;//可以出售
|
|
||||
public int price;//价格
|
|
||||
public float discount;//折扣
|
|
||||
public Text priceText;//售价UI
|
|
||||
public GameObject saledIcon;//已售出标识
|
|
||||
|
|
||||
//商店界面
|
|
||||
public void ReturnSelectedDeleteIndex() |
|
||||
{ |
|
||||
// ShopManager.Instance.selectedDeleteIndex = cardIndex;
|
|
||||
|
|
||||
} |
|
||||
public void BuyCard() |
|
||||
{ |
|
||||
if (canSale && ShopManager.Instance.playerState.money >= (int)(price * discount)) |
|
||||
{ |
|
||||
ShopManager.Instance.cardDeck.Add(cardId); |
|
||||
saledIcon.SetActive(true); |
|
||||
|
|
||||
ShopManager.Instance.playerState .money -= (int)(price * discount); |
|
||||
canSale = false; |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
Debug.Log("金币不足"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void SetUpSaleCard() |
|
||||
{ |
|
||||
priceText.text = ((int)price * discount).ToString(); |
|
||||
} |
|
||||
|
|
||||
//奖励界面
|
|
||||
public void RewardCardToDeck() |
|
||||
{ |
|
||||
PlayerStatsManager .Instance.cardDeck.cardDeckList.Add(this .cardId); |
|
||||
|
|
||||
RewardManager.Instance.DeleteRewardTip(currentRewardCardTip); |
|
||||
currentRewardCardTip.GetComponent <RewardTipData>().cardChoosePanle . SetActive(false); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
//创建卡牌
|
|
||||
public void createCard(string cardId, int cardIndex) |
|
||||
{ |
|
||||
this.cardId = cardId; |
|
||||
cardOriginalData = CardOriginalDataList.Instance.cardOriginalDataList[cardId]; |
|
||||
|
|
||||
//createCardDescription();
|
|
||||
createCardName(); |
|
||||
createCardCost(); |
|
||||
createCardImage(); |
|
||||
this.cardIndex = cardIndex; |
|
||||
} |
|
||||
|
|
||||
//获取卡牌图片
|
|
||||
public void createCardImage() |
|
||||
{ |
|
||||
if (cardOriginalData.ImgPath != null) |
|
||||
{ |
|
||||
Sprite sprite = Resources.Load<Sprite>(cardOriginalData.ImgPath); |
|
||||
if (sprite != null) |
|
||||
{ |
|
||||
cardImage.sprite = sprite; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
//获取卡牌名字
|
|
||||
public void createCardName() |
|
||||
{ |
|
||||
cardName.text = cardOriginalData.ChineseName; |
|
||||
} |
|
||||
|
|
||||
public void createCardCost() |
|
||||
{ |
|
||||
cost.text = cardOriginalData.Cost.ToString(); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 9b611725eb88f0f4e81cfeecc8caeef2 |
||||
|
folderAsset: yes |
||||
|
DefaultImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class RewardCardNode : MonoBehaviour |
||||
|
{ |
||||
|
public string cardID; |
||||
|
public GameObject rewardTip; |
||||
|
public void RewardCardToDeck() |
||||
|
{ |
||||
|
PlayerStatsManager.Instance.cardDeck.cardDeckList.Add(this.cardID); |
||||
|
|
||||
|
RewardManager.Instance.DeleteRewardTip(rewardTip); |
||||
|
rewardTip.GetComponent<RewardTipData>().cardChoosePanle.SetActive(false); |
||||
|
//ÉùÒô
|
||||
|
AudioManager.Instance.GainCardVoicePlayer(); |
||||
|
} |
||||
|
} |
||||
@ -1,5 +1,5 @@ |
|||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||
guid: c3237ec859125a24a8de6cc0ccd79d00 |
guid: 6a52df32d6b281b4c80de6a8b468bc2f |
||||
MonoImporter: |
MonoImporter: |
||||
externalObjects: {} |
externalObjects: {} |
||||
serializedVersion: 2 |
serializedVersion: 2 |
||||