65 changed files with 250019 additions and 469 deletions
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ac8bf1948172fe144b114044653e2070 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
|
After Width: | Height: | Size: 231 KiB |
@ -0,0 +1,127 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 0ef8f235e60316d40902e0abd0fc1712 |
|||
TextureImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 12 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
sRGBTexture: 1 |
|||
linearTexture: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapsPreserveCoverage: 0 |
|||
alphaTestReferenceValue: 0.5 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
flipGreenChannel: 0 |
|||
isReadable: 0 |
|||
streamingMipmaps: 0 |
|||
streamingMipmapsPriority: 0 |
|||
vTOnly: 0 |
|||
ignoreMipmapLimit: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: 1 |
|||
aniso: 1 |
|||
mipBias: 0 |
|||
wrapU: 1 |
|||
wrapV: 1 |
|||
wrapW: 0 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 1 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spritePixelsToUnits: 100 |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spriteGenerateFallbackPhysicsShape: 1 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 1 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 8 |
|||
textureShape: 1 |
|||
singleChannelComponent: 0 |
|||
flipbookRows: 1 |
|||
flipbookColumns: 1 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
ignorePngGamma: 0 |
|||
applyGammaDecoding: 0 |
|||
swizzle: 50462976 |
|||
cookieLightType: 0 |
|||
platformSettings: |
|||
- serializedVersion: 3 |
|||
buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
ignorePlatformSupport: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
ignorePlatformSupport: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Server |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
ignorePlatformSupport: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
bones: [] |
|||
spriteID: 5e97eb03825dee720800000000000000 |
|||
internalID: 0 |
|||
vertices: [] |
|||
indices: |
|||
edges: [] |
|||
weights: [] |
|||
secondaryTextures: [] |
|||
nameFileIdTable: {} |
|||
mipmapLimitGroupName: |
|||
pSDRemoveMatte: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
|
After Width: | Height: | Size: 45 KiB |
@ -0,0 +1,127 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e4c4ee7f88070ef439dde49c5d320056 |
|||
TextureImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 12 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
sRGBTexture: 1 |
|||
linearTexture: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapsPreserveCoverage: 0 |
|||
alphaTestReferenceValue: 0.5 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
flipGreenChannel: 0 |
|||
isReadable: 0 |
|||
streamingMipmaps: 0 |
|||
streamingMipmapsPriority: 0 |
|||
vTOnly: 0 |
|||
ignoreMipmapLimit: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: 1 |
|||
aniso: 1 |
|||
mipBias: 0 |
|||
wrapU: 1 |
|||
wrapV: 1 |
|||
wrapW: 0 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 1 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spritePixelsToUnits: 100 |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spriteGenerateFallbackPhysicsShape: 1 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 1 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 8 |
|||
textureShape: 1 |
|||
singleChannelComponent: 0 |
|||
flipbookRows: 1 |
|||
flipbookColumns: 1 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
ignorePngGamma: 0 |
|||
applyGammaDecoding: 0 |
|||
swizzle: 50462976 |
|||
cookieLightType: 0 |
|||
platformSettings: |
|||
- serializedVersion: 3 |
|||
buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
ignorePlatformSupport: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
ignorePlatformSupport: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Server |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
ignorePlatformSupport: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
bones: [] |
|||
spriteID: 5e97eb03825dee720800000000000000 |
|||
internalID: 0 |
|||
vertices: [] |
|||
indices: |
|||
edges: [] |
|||
weights: [] |
|||
secondaryTextures: [] |
|||
nameFileIdTable: {} |
|||
mipmapLimitGroupName: |
|||
pSDRemoveMatte: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 36de95eabae2e9644a79cc219b979b9c |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c3667648a8ade234f92f92a6374b6677 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,77 @@ |
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &8994229302283814141 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1244993844072723001} |
|||
- component: {fileID: 9006635132949783329} |
|||
- component: {fileID: 14232235446758241} |
|||
m_Layer: 0 |
|||
m_Name: CardViewSlot |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &1244993844072723001 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8994229302283814141} |
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: -0.000012070142} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_ConstrainProportionsScale: 0 |
|||
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 &9006635132949783329 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8994229302283814141} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &14232235446758241 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8994229302283814141} |
|||
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: 1, g: 1, b: 1, a: 0} |
|||
m_RaycastTarget: 0 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 0} |
|||
m_Type: 0 |
|||
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: 72eaeda7f4d5e34479c7b0570e2c929f |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 4602fa0b374871844a83f28c533b21d9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 594e0d0a23d0a694eacbd11b8b90922d |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: f94c1cdcdd8bb7847ad5b7ed24ec70f1 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: b0cf7c6e217d2cf40b5e5688c576578d |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c962acc1a1a596c40873b539fb9aa49e |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 44128e5f9cb9fd643a474ad5485c191b |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 3d7b8941c07c75348ab3df4c5b59d6f4 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 35ca3314a7ab9c1409085d7103986ba1 |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: f1080414603d07143abc0f860002b69c |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,29 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
|
|||
public class CardTypeHeaderNode : MonoBehaviour |
|||
{ |
|||
public Text text; |
|||
public Image image; |
|||
public bool isFold; |
|||
public List<string> cardId; |
|||
public void SwitchStats() |
|||
{ |
|||
switch (isFold) |
|||
{ |
|||
case true: |
|||
isFold = false; |
|||
text.text = "-"; |
|||
image.color = Color.white; |
|||
break; |
|||
case false: |
|||
isFold = true; |
|||
text.text = "+"; |
|||
image.color = Color.gray; |
|||
break; |
|||
} |
|||
ForgintPointManager.Instance.GenerateViewCard(); |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 4bab6e8b6b3ab79429996dee9e42be88 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,388 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.EventSystems; |
|||
using UnityEngine.InputSystem; |
|||
using static GameManager; |
|||
|
|||
public class ForgintPointManager : Singleton<ForgintPointManager> |
|||
{ |
|||
public GameObject generatePoint; |
|||
[Header("地图")] |
|||
public GameObject mapUnity; |
|||
public int line; |
|||
public int column; |
|||
public Vector3 lineOffSet; |
|||
public Vector3 columnOffSet; |
|||
public Transform mapUnityFather; |
|||
[Header("地图信息列表")] |
|||
public List<Yunit> mapList; |
|||
[Header("卡牌筛选按钮信息")] |
|||
public List<CardTypeHeaderNode> cardTypeHeaderButton = new List<CardTypeHeaderNode>();//存储卡牌图片做多选处理
|
|||
[Header("卡组信息")] |
|||
public List<string> colorDeck; |
|||
public List<string> effectDeck; |
|||
public GameObject cardViewSlot;//排布卡槽
|
|||
public List<Transform> cardGenerateFatherList = new List<Transform>();//卡牌生成位置
|
|||
public List<GameObject> cardObject;//实际生成的卡牌
|
|||
[Header("选中卡牌大图")] |
|||
public CardEntity chooseCardEntity; |
|||
public Transform chooseCardFather; |
|||
[Header("事件系统")] |
|||
public EventSystem eventSystem; |
|||
PointerEventData eventData; |
|||
List<RaycastResult> result = new List<RaycastResult>(); |
|||
[Header("是否开启铸造界面")] |
|||
public ForgingStats forgingStats; |
|||
public enum ForgingStats |
|||
{ |
|||
none, |
|||
colorForg, |
|||
effectForg |
|||
} |
|||
[Header("颜色选择射线图层剔除")] |
|||
public LayerMask groundLayerMask; |
|||
[Header("铸造颜色时被选中的地块")] |
|||
public MapUnity choosedMapUnity; |
|||
HashSet<MapUnity> choosedMapUnityPool = new HashSet<MapUnity> (); |
|||
bool isColorDone = true ;//间断点击地块,不会因为点击按钮点到下一个地块
|
|||
[Header("铸造颜色弹窗")] |
|||
public GameObject colorSelectUI; |
|||
|
|||
private void Start() |
|||
{ |
|||
eventData = new PointerEventData(eventSystem); |
|||
|
|||
LoadCardId(); |
|||
GenerateViewCard(); |
|||
|
|||
GenerateEnmptyMapListForTool(); |
|||
StartCoroutine(GenerateProcessTest()); |
|||
} |
|||
private void Update() |
|||
{ |
|||
if(Mouse.current.leftButton.wasReleasedThisFrame) |
|||
{ |
|||
switch (forgingStats) |
|||
{ |
|||
case ForgingStats.none: |
|||
eventData.position = Mouse.current.position.value; |
|||
|
|||
eventSystem.RaycastAll(eventData, result); |
|||
if (result.Count > 0 && result[0].gameObject.tag == "Card") |
|||
{ |
|||
ChooseViewCard(result[0].gameObject.GetComponent<CardEntity>().cardId); |
|||
} |
|||
break; |
|||
case ForgingStats.colorForg: |
|||
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.value); |
|||
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, groundLayerMask.value) && isColorDone ==true) |
|||
{ |
|||
MapUnity mapUnity = raycastHit.collider.transform.GetComponent<MapUnity>(); |
|||
if(choosedMapUnity !=null ) |
|||
{ |
|||
choosedMapUnity.influenced = false; |
|||
} |
|||
// mapUnity.influenced = true;
|
|||
choosedMapUnityPool.Clear(); |
|||
choosedMapUnityPool.Add(mapUnity); |
|||
mapUnity.PlayerInfluenced(choosedMapUnityPool); |
|||
choosedMapUnity = mapUnity; |
|||
|
|||
//同步UI
|
|||
Vector3 pos = mapUnity.transform.position; |
|||
pos.y = -1.5f; |
|||
colorSelectUI.transform.position = pos; |
|||
colorSelectUI .SetActive (true); |
|||
|
|||
isColorDone = false; |
|||
} |
|||
break; |
|||
case ForgingStats.effectForg: |
|||
eventData.position = Mouse.current.position.value; |
|||
|
|||
eventSystem.RaycastAll(eventData, result); |
|||
if (result.Count > 0 && result[0].gameObject.tag == "Card") |
|||
{ |
|||
ChooseViewCard(result[0].gameObject.GetComponent<CardEntity>().cardId); |
|||
} |
|||
break; |
|||
} |
|||
|
|||
} |
|||
|
|||
if(Mouse.current.rightButton .wasReleasedThisFrame&&forgingStats == ForgingStats.colorForg ) |
|||
{ |
|||
CancelMapUnityChoose(); |
|||
} |
|||
} |
|||
//右键取消
|
|||
public void CancelMapUnityChoose() |
|||
{ |
|||
if (choosedMapUnity != null ) |
|||
{ |
|||
choosedMapUnity.influenced = false; |
|||
choosedMapUnity = null; |
|||
} |
|||
isColorDone = true; |
|||
colorSelectUI.SetActive(false); |
|||
} |
|||
IEnumerator GenerateProcessTest() |
|||
{ |
|||
yield return StartCoroutine(MapGenerateTest()); |
|||
yield return StartCoroutine(TransformMapUnityForTool()); |
|||
yield return StartCoroutine(SetUpMapUnityForTool()); |
|||
yield return StartCoroutine(SetUpMapUnityForCubeForTool()); |
|||
} |
|||
IEnumerator MapGenerateTest() |
|||
{ |
|||
int middleLine = (line - 1) / 2; |
|||
int currentColumn = column; |
|||
|
|||
for (int i = 0; i < line; i++) |
|||
{ |
|||
if (i != 0) |
|||
{ |
|||
generatePoint.transform.position += columnOffSet; |
|||
} |
|||
generatePoint.transform.position = new Vector3(0,0, generatePoint.transform.position.z); |
|||
|
|||
|
|||
if (i <= middleLine) |
|||
{ |
|||
if (i != 0) |
|||
{ |
|||
currentColumn += 1; |
|||
generatePoint.transform.position -= (lineOffSet / 2f) * i; |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
currentColumn -= 1; |
|||
generatePoint.transform.position -= (lineOffSet / 2f) * (line - i - 1); |
|||
} |
|||
Debug.Log("列数:" + currentColumn + "中间值:" + middleLine); |
|||
for (int j = 0; j < currentColumn; j++) |
|||
{ |
|||
var a = Instantiate(mapUnity, generatePoint.transform.position - new Vector3(0, 2, 0), mapUnity.transform.rotation); |
|||
a.transform.SetParent(mapUnityFather); |
|||
MapUnity currentMapUnityScript = a.GetComponent<MapUnity>(); |
|||
currentMapUnityScript.locationX = i; |
|||
currentMapUnityScript.locationY = j; |
|||
currentMapUnityScript.RegisterUnitToList(mapList); |
|||
generatePoint.transform.position += lineOffSet; |
|||
} |
|||
} |
|||
yield return null; |
|||
} |
|||
|
|||
IEnumerator TransformMapUnityForTool() |
|||
{ |
|||
int x = 0, y = 0; |
|||
int count = 1; |
|||
int currentOffset = 0; |
|||
int middeline = mapList.Count / 2; |
|||
List<int> lineOffsetList = new List<int>(); |
|||
int lineOffsetListMark = 1; |
|||
for (int i = 0; i < mapList.Count; i++) |
|||
{ |
|||
if (count >= 2) |
|||
{ |
|||
count = 0; |
|||
if (i <= middeline) |
|||
{ |
|||
currentOffset += 1; |
|||
|
|||
} |
|||
} |
|||
if (i < middeline) |
|||
{ |
|||
lineOffsetList.Add(currentOffset); |
|||
} |
|||
else if (i > middeline) |
|||
{ |
|||
currentOffset = lineOffsetList[lineOffsetList.Count - lineOffsetListMark]; |
|||
lineOffsetListMark += 1; |
|||
} |
|||
|
|||
|
|||
for (int j = 0; j < mapList[i].Y.Count; j++) |
|||
{ |
|||
|
|||
mapList[i].Y[j].ResetLocation(j - currentOffset, y); |
|||
|
|||
} |
|||
x = 0; |
|||
y = i + 1; |
|||
count += 1; |
|||
} |
|||
yield return null; |
|||
} |
|||
|
|||
IEnumerator SetUpMapUnityForTool() |
|||
{ |
|||
// yield return StartCoroutine(MapGenerate());
|
|||
for (int i = 0; i < mapList.Count; i++) |
|||
{ |
|||
for (int j = 0; j < mapList[i].Y.Count; j++) |
|||
{ |
|||
mapList[i].Y[j].StartRegiste(); |
|||
} |
|||
} |
|||
yield return null; |
|||
} |
|||
|
|||
IEnumerator SetUpMapUnityForCubeForTool() |
|||
{ |
|||
// yield return StartCoroutine(MapGenerate());
|
|||
for (int i = 0; i < mapList.Count; i++) |
|||
{ |
|||
for (int j = 0; j < mapList[i].Y.Count; j++) |
|||
{ |
|||
mapList[i].Y[j].CalCube(); |
|||
} |
|||
} |
|||
yield return null; |
|||
} |
|||
|
|||
|
|||
public void GenerateEnmptyMapListForTool() |
|||
{ |
|||
int currentColumn = column - 1; |
|||
for (int i = 0; i < line; i++) |
|||
{ |
|||
if (i <= (line - 1) / 2) |
|||
{ |
|||
currentColumn += 1; |
|||
} |
|||
else |
|||
{ |
|||
currentColumn -= 1; |
|||
} |
|||
for (int j = 0; j < currentColumn; j++) |
|||
{ |
|||
mapList[i].Y.Add(null); |
|||
} |
|||
} |
|||
} |
|||
//读取卡牌
|
|||
public void LoadCardId() |
|||
{ |
|||
foreach (var id in PlayerStatsManager.Instance.cardDeck.cardDeckList) |
|||
{ |
|||
if (int.Parse(id) > 1999) |
|||
{ |
|||
cardTypeHeaderButton[1].cardId .Add(id); |
|||
} |
|||
else |
|||
{ |
|||
cardTypeHeaderButton[0].cardId.Add(id); |
|||
} |
|||
} |
|||
} |
|||
//生成卡组
|
|||
public void GenerateViewCard() |
|||
{ |
|||
for(int i=0;i<cardObject .Count;i++) |
|||
{ |
|||
Destroy(cardObject[i]); |
|||
} |
|||
cardObject.Clear(); |
|||
|
|||
|
|||
|
|||
|
|||
for (int i = 0; i < cardTypeHeaderButton.Count; i++) |
|||
{ |
|||
//确定父级框体大小和位置
|
|||
float heightPos = 0; |
|||
for (int j = 0; j < i; j++) |
|||
{ |
|||
heightPos += cardGenerateFatherList[j].GetComponent<RectTransform>().sizeDelta.y; |
|||
} |
|||
cardGenerateFatherList[i].GetComponent<RectTransform>().anchoredPosition = new Vector3(0, -(heightPos + 50 * i+20), 0); |
|||
cardTypeHeaderButton[i].transform.parent.GetComponent<RectTransform>().anchoredPosition = new Vector3(0, -(heightPos), 0); |
|||
|
|||
if (cardTypeHeaderButton[i].isFold ==false ) |
|||
{ |
|||
cardGenerateFatherList[i].GetComponent<RectTransform>().sizeDelta = new Vector2(0, 15 + 425 * (cardTypeHeaderButton[i].cardId.Count/4+1)); |
|||
|
|||
} |
|||
else |
|||
{ |
|||
cardGenerateFatherList[i].GetComponent<RectTransform>().sizeDelta = new Vector2(0, 50); |
|||
} |
|||
|
|||
if (cardTypeHeaderButton[i].isFold ==false ) |
|||
{ |
|||
|
|||
//生成卡牌
|
|||
for (int j = 0; j < cardTypeHeaderButton[i].cardId.Count;j++) |
|||
{ |
|||
var slot = Instantiate(cardViewSlot, cardGenerateFatherList[i]); |
|||
var card = PlayerStatsManager.Instance.CreateCardWithIDForLook(cardTypeHeaderButton[i].cardId[i], slot.transform); |
|||
card.transform.localScale = new Vector3(1.7f, 1.7f, 1.7f); |
|||
card.transform.localPosition = new Vector3(0, 0, 0); |
|||
cardObject.Add(slot); |
|||
} |
|||
|
|||
//占位换行
|
|||
int remainder = (i + 1) % 4; |
|||
if (remainder != 0) |
|||
{ |
|||
for (int j = 0; j < 4 - remainder; j++) |
|||
{ |
|||
var slot = Instantiate(cardViewSlot, cardGenerateFatherList[i]); |
|||
cardObject.Add(slot); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
//生成卡牌大图
|
|||
public void ChooseViewCard(string cardId) |
|||
{ |
|||
if(chooseCardEntity!= null ) |
|||
{ |
|||
Destroy(chooseCardEntity.gameObject); |
|||
} |
|||
var card = PlayerStatsManager.Instance.CreateCardWithIDForLook(cardId, chooseCardFather); |
|||
card.transform.localScale = new Vector3(3.45f, 3.45f, 3.45f); |
|||
card.transform.localPosition = new Vector3(0, 0, 0); |
|||
chooseCardEntity = card.GetComponent<CardEntity>(); |
|||
} |
|||
|
|||
//锻造改色方法
|
|||
public void ChangeColor(int color) |
|||
{ |
|||
choosedMapUnity.switchColor(color); |
|||
choosedMapUnity.influenced = false; |
|||
colorSelectUI .SetActive (false); |
|||
StartCoroutine(IsColorDone(0.1f)); |
|||
} |
|||
|
|||
public IEnumerator IsColorDone(float time) |
|||
{ |
|||
yield return new WaitForSeconds(time); |
|||
isColorDone = true; |
|||
} |
|||
//更改状态
|
|||
public void ChangeColoringStats(int stats) |
|||
{ |
|||
switch (stats) |
|||
{ |
|||
case 0: |
|||
forgingStats = ForgingStats.none; |
|||
break; |
|||
case 1: |
|||
forgingStats = ForgingStats.colorForg; |
|||
break; |
|||
case 2: |
|||
forgingStats = ForgingStats.effectForg; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 9ce2e5e147d5f52478303d707e0350f4 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
Loading…
Reference in new issue