@ -1,525 +0,0 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using Unity.VisualScripting; |
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
using UnityEngine.EventSystems; |
|||
using UnityEngine.InputSystem; |
|||
|
|||
public class CardEntity_OldSave : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler |
|||
{ |
|||
public CardOriginalData cardOriginalData; |
|||
//public CardOriginalData cardData;
|
|||
|
|||
public int cardId; |
|||
public int CardId |
|||
{ |
|||
get { return cardId; } |
|||
set { cardId = value; } |
|||
} |
|||
|
|||
// public Vector3 OriginTransform;
|
|||
//private Vector3 EndTransform;
|
|||
[Header("拖拽参数")] |
|||
public Transform originalParent; |
|||
public Vector3 originalpoint; |
|||
|
|||
bool canUse = true;//决定卡牌是否可以释放
|
|||
bool choosed;//标识卡牌是否被选中
|
|||
|
|||
[Header("贝塞尔曲线瞄准")] |
|||
public GameObject ainPanle; |
|||
|
|||
[Header("影响格参数")] |
|||
public MapUnity currentNode;//瞄准的格子
|
|||
public List<MapUnity> influencePreviewPool;//卡牌的影响范围
|
|||
|
|||
[Header("卡牌拖拽状态")] |
|||
public CardDragState dragState; |
|||
public enum CardDragState |
|||
{ |
|||
onBeginDrag, |
|||
onDrag, |
|||
onEndDrag, |
|||
noDrag |
|||
} |
|||
public EventSystem eventSystem; |
|||
PointerEventData eventData; |
|||
List<RaycastResult> result = new List<RaycastResult>(); |
|||
|
|||
public void Start() |
|||
{ |
|||
//cardData = GetComponent<CardOriginalData>();
|
|||
eventSystem = GameObject.FindObjectOfType<EventSystem>(); |
|||
eventData = new PointerEventData(eventSystem); |
|||
} |
|||
private void Update() |
|||
{ |
|||
//右键取消释放
|
|||
if (choosed && Mouse.current.rightButton.wasPressedThisFrame) |
|||
{ |
|||
Debug.Log("1"); |
|||
dragState = CardDragState.noDrag; |
|||
canUse = false;//取消释放
|
|||
ainPanle.SetActive(false); |
|||
//遍历范围预览池消除影响色
|
|||
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) |
|||
{ |
|||
GameManager.Instance.player.influencePreviewPool[i].influenced = false; |
|||
} |
|||
GameManager.Instance.player.influencePreviewPool.Clear(); |
|||
//遍历影响池变色
|
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
influencePreviewPool[i].influenced = false; |
|||
} |
|||
influencePreviewPool.Clear(); |
|||
|
|||
|
|||
//其他位置都归位
|
|||
transform.SetParent(originalParent); |
|||
transform.localPosition = originalpoint; |
|||
GetComponent<CanvasGroup>().blocksRaycasts = true; |
|||
return; |
|||
} |
|||
|
|||
if (dragState != CardDragState.noDrag && dragState != CardDragState.onDrag) |
|||
{ |
|||
//UI射线检测
|
|||
|
|||
eventData.position = Mouse.current.position.value; |
|||
|
|||
eventSystem.RaycastAll(eventData, result); |
|||
if (result.Count > 0) |
|||
{ |
|||
Debug.Log(result[0].gameObject.name); |
|||
} |
|||
} |
|||
|
|||
|
|||
switch (dragState) |
|||
{ |
|||
case CardDragState.onBeginDrag: |
|||
TurnMaster.Instance.playerAction = TurnMaster.PlayerAction.useCard; |
|||
CardChoose(eventData); |
|||
dragState = CardDragState.onDrag; |
|||
break; |
|||
case CardDragState.onDrag: |
|||
CardFollow(); |
|||
if (Mouse.current.leftButton.wasReleasedThisFrame) |
|||
{ |
|||
dragState = CardDragState.onEndDrag; |
|||
} |
|||
break; |
|||
case CardDragState.onEndDrag: |
|||
TurnMaster.Instance.playerAction = TurnMaster.PlayerAction.none; |
|||
CardUse(); |
|||
break; |
|||
case CardDragState.noDrag: |
|||
if (Mouse.current.leftButton.wasReleasedThisFrame) |
|||
{ |
|||
eventData.position = Mouse.current.position.value; |
|||
|
|||
eventSystem.RaycastAll(eventData, result); |
|||
if (result.Count > 0) |
|||
{ |
|||
Debug.Log(result[0].gameObject.name); |
|||
if (result[0].gameObject == this.gameObject) |
|||
{ |
|||
dragState = CardDragState.onBeginDrag; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
break; |
|||
} |
|||
|
|||
} |
|||
|
|||
public void createCard(int cardId) |
|||
{ |
|||
this.cardId = cardId; |
|||
Debug.Log(cardId + "-" + CardOriginalDataList.Instance.cardOriginalDataList[cardId]); |
|||
cardOriginalData = CardOriginalDataList.Instance.cardOriginalDataList[cardId]; |
|||
settleForStart(SettlementManager.settleTurn); |
|||
} |
|||
|
|||
//不应该为void,返回值为作用的地块
|
|||
public void use() |
|||
{ |
|||
settle(0); |
|||
|
|||
|
|||
} |
|||
//卡牌效果的结算
|
|||
public void settle(int settleTurn) |
|||
{ |
|||
for (int i = 0; i < cardOriginalData.Function.Length; i++) |
|||
{ |
|||
switch (cardOriginalData.Function[i]) |
|||
{ |
|||
case CardFunction.cardDamage: |
|||
damageWork(int.Parse(cardOriginalData.FunctionVal[i])); |
|||
break; |
|||
case CardFunction.cardShield: |
|||
Usermanager.Instance.Shield = Usermanager.Instance.Shield + int.Parse(cardOriginalData.FunctionVal[i]); |
|||
break; |
|||
case CardFunction.posion: |
|||
case CardFunction.weak: |
|||
case CardFunction.coma: |
|||
case CardFunction.disarm: |
|||
case CardFunction.sleep: |
|||
case CardFunction.bleed: |
|||
case CardFunction.thorn: |
|||
abnormalConditionWork(cardOriginalData.Function[i], int.Parse(cardOriginalData.FunctionVal[i])); |
|||
break; |
|||
case CardFunction.costRestore: |
|||
break; |
|||
case CardFunction.dyeing: |
|||
Debug.Log("功能是:" + cardOriginalData.Function[1]); |
|||
dyeingWork(); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
public void abnormalConditionWork(string condition, int stackVak) |
|||
{ |
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
//施加负面
|
|||
if (influencePreviewPool[i].enemyNode != null) |
|||
{ |
|||
influencePreviewPool[i].enemyNode.sufferAbnormalCondition(condition, stackVak); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private void damageWork(int damageVal) |
|||
{ |
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
//造成伤害
|
|||
if (influencePreviewPool[i].enemyNode != null) |
|||
{ |
|||
influencePreviewPool[i].enemyNode.sufferDamage(damageVal); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private void dyeingWork() |
|||
{ |
|||
Debug.Log(influencePreviewPool.Count); |
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
influencePreviewPool[i].whoColour = MapUnity.WhoColour.playerColour; |
|||
} |
|||
} |
|||
|
|||
private void dyeing() |
|||
{ |
|||
//遍历影响池变色
|
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
influencePreviewPool[i].influenced = true; |
|||
influencePreviewPool[i].choossedMark.GetComponent<Renderer>().material = influencePreviewPool[i].yellow; |
|||
} |
|||
} |
|||
|
|||
|
|||
//生成卡牌时候遗物的结算
|
|||
public void settleForStart(int settleTurn) |
|||
{ |
|||
|
|||
} |
|||
//卡牌效果结束之后结算
|
|||
public void settleForEnd(int settleTurn) |
|||
{ |
|||
|
|||
} |
|||
|
|||
public void OnBeginDrag(PointerEventData eventData) |
|||
{ |
|||
dragState = CardDragState.onBeginDrag; |
|||
} |
|||
|
|||
public void OnDrag(PointerEventData eventData) |
|||
{ |
|||
|
|||
} |
|||
|
|||
private void ainPanleWork() |
|||
{ |
|||
//射线检测瞄准的地图节点,判断是否可放置和改变放置影响区
|
|||
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.value); |
|||
|
|||
if (Physics.Raycast(ray, out RaycastHit raycastHit)) |
|||
{ |
|||
Debug.Log(raycastHit.collider.gameObject.name); |
|||
//检测到跟上次瞄准地方不同,更新
|
|||
if (currentNode == null || raycastHit.collider.transform.gameObject != currentNode.gameObject) |
|||
{ |
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
influencePreviewPool[i].influenced = false; |
|||
} |
|||
influencePreviewPool.Clear(); |
|||
currentNode = raycastHit.collider.transform.GetComponent<MapUnity>(); |
|||
|
|||
//重新调用范围预览
|
|||
GameManager.Instance.player.StepPreviewInfluencedNode(cardOriginalData.CastingRange); |
|||
Debug.Log(cardOriginalData.CastingRange); |
|||
//预览影响范围
|
|||
if (currentNode.influenced) |
|||
{ |
|||
//根据卡牌属性改变影响池
|
|||
influencePreviewPool.Add(currentNode); |
|||
Vector3 face = currentNode.transform.position - GameManager.Instance.playerOn.transform.position; |
|||
float euler = Vector3.SignedAngle(-GameManager.Instance.playerOn.transform.forward, face, GameManager.Instance.playerOn.transform.up) + 180; |
|||
Debug.Log(euler); |
|||
if (euler > 0 && euler < 45) |
|||
{ |
|||
if (currentNode.unitPool[0] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[0]); |
|||
if (currentNode.unitPool[4] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[4]); |
|||
} |
|||
else if (euler > 45 && euler < 135) |
|||
{ |
|||
if (currentNode.unitPool[1] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[1]); |
|||
if (currentNode.unitPool[5] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[5]); |
|||
} |
|||
else if (euler > 135 && euler < 180) |
|||
{ |
|||
if (currentNode.unitPool[2] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[2]); |
|||
if (currentNode.unitPool[0] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[0]); |
|||
} |
|||
else if (euler > 180 && euler < 225) |
|||
{ |
|||
if (currentNode.unitPool[1] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[1]); |
|||
if (currentNode.unitPool[3] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[3]); |
|||
} |
|||
else if (euler > 225 && euler < 315) |
|||
{ |
|||
if (currentNode.unitPool[2] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[2]); |
|||
if (currentNode.unitPool[4] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[4]); |
|||
} |
|||
else if (euler > 315 && euler < 360) |
|||
{ |
|||
if (currentNode.unitPool[3] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[3]); |
|||
if (currentNode.unitPool[5] != null) |
|||
influencePreviewPool.Add(currentNode.unitPool[5]); |
|||
} |
|||
//influencePreviewPool.Add(currentNode);
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
|
|||
Debug.Log("结束影响数值" + influencePreviewPool.Count); |
|||
} |
|||
|
|||
private void noAinPanleWork(PointerEventData eventData) |
|||
{ |
|||
|
|||
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.value); |
|||
if (eventData.pointerCurrentRaycast.gameObject != null) |
|||
{ |
|||
if (Physics.Raycast(ray, out RaycastHit raycastHit)) |
|||
{ |
|||
currentNode = raycastHit.collider.transform.GetComponent<MapUnity>(); |
|||
influencePreviewPool.Add(currentNode); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
public void OnEndDrag(PointerEventData eventData) |
|||
{ |
|||
|
|||
} |
|||
|
|||
//卡片动作
|
|||
//开始选中
|
|||
public void CardChoose(PointerEventData eventData) |
|||
{ |
|||
// if (GameObject.Find("CardPanel") != null)
|
|||
// graphicRaycaster = GameObject.Find("CardPanel").GetComponent<GraphicRaycaster>();
|
|||
choosed = true; |
|||
|
|||
GetComponent<CanvasGroup>().blocksRaycasts = false; |
|||
|
|||
originalParent = this.gameObject.transform.parent; |
|||
originalpoint = this.transform.localPosition; |
|||
|
|||
transform.SetParent(transform.parent.parent); |
|||
transform.position = eventData.position; |
|||
|
|||
//根据卡牌数据决定是否调用曲线
|
|||
if (cardOriginalData.CastingRange != 0) |
|||
{ |
|||
//释放范围为0则不需要调用曲线
|
|||
ainPanle.SetActive(true); |
|||
} |
|||
else |
|||
{ |
|||
ainPanle.SetActive(false); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
//todo-统一确定锚点位置
|
|||
|
|||
//重新调用范围预览--以后要写到卡牌效果里,现在默认影响1格
|
|||
//GameManager.Instance.player.StepPreviewInfluencedNode(1);
|
|||
} |
|||
|
|||
//拖拽中
|
|||
public void CardFollow() |
|||
{ |
|||
if (cardOriginalData.CastingRange != 0) |
|||
{ |
|||
ainPanleWork(); |
|||
} |
|||
else |
|||
{ |
|||
//没有范围不需要射线吧,因为不需要指定目标点?
|
|||
// noAinPanleWork(eventData);
|
|||
} |
|||
dyeing(); |
|||
} |
|||
|
|||
//卡牌释放
|
|||
public void CardUse() |
|||
{ |
|||
choosed = false; |
|||
if (canUse) |
|||
{ |
|||
Debug.Log("进入影响数值" + influencePreviewPool.Count); |
|||
if (result.Count > 0) |
|||
{ |
|||
if (result[0].gameObject.tag == "Card") |
|||
{ |
|||
choosed = true; |
|||
dragState = CardDragState.onDrag; |
|||
TurnMaster.Instance.playerAction = TurnMaster.PlayerAction.useCard; |
|||
/* |
|||
GetComponent<CanvasGroup>().blocksRaycasts = true; |
|||
|
|||
ainPanle.SetActive(false);//关闭贝塞尔曲线
|
|||
//遍历范围预览池消除影响色
|
|||
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) |
|||
{ |
|||
GameManager.Instance.player.influencePreviewPool[i].influenced = false; |
|||
} |
|||
//GameManager.Instance.player.influencePreviewPool.Clear();
|
|||
*/ |
|||
return; |
|||
} |
|||
else if (result[0].gameObject.name == "cardSlot") |
|||
{ |
|||
choosed = true; |
|||
dragState = CardDragState.onDrag; |
|||
TurnMaster.Instance.playerAction = TurnMaster.PlayerAction.useCard; |
|||
/* |
|||
transform.SetParent(result[0].gameObject.transform); |
|||
transform.position = result [0].gameObject.transform.position; |
|||
GetComponent<CanvasGroup>().blocksRaycasts = true; |
|||
|
|||
ainPanle.SetActive(false);//关闭贝塞尔曲线
|
|||
//遍历范围预览池消除影响色
|
|||
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) |
|||
{ |
|||
GameManager.Instance.player.influencePreviewPool[i].influenced = false; |
|||
} |
|||
//GameManager.Instance.player.influencePreviewPool.Clear();
|
|||
*/ |
|||
return; |
|||
} |
|||
} |
|||
if (ainPanle.activeSelf) |
|||
{ |
|||
ainPanle.SetActive(false);//关闭贝塞尔曲线
|
|||
} |
|||
|
|||
//先判断该卡牌的类型是否是需要范围
|
|||
if (cardOriginalData.CastingRange != 0) |
|||
{ |
|||
//检测碰撞的地图节点是否被影响(可释放)
|
|||
if (currentNode == null || currentNode.influenced == false) |
|||
{ |
|||
//遍历范围预览池消除影响色(红色,卡牌的释放范围)
|
|||
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) |
|||
{ |
|||
GameManager.Instance.player.influencePreviewPool[i].influenced = false; |
|||
} |
|||
//GameManager.Instance.player.influencePreviewPool.Clear();
|
|||
} |
|||
else if (currentNode.influenced) |
|||
{ |
|||
|
|||
//卡牌释放效果
|
|||
use(); |
|||
Debug.Log("玩家盾量:" + Usermanager.Instance.Shield); |
|||
|
|||
//临时效果--将其加入墓地并销毁实体
|
|||
TurnMaster.Instance.usedCard.usedCardList.Add(this.gameObject.GetComponent<CardEntity>().CardId); |
|||
Destroy(this.gameObject); |
|||
} |
|||
//遍历范围预览池消除影响色
|
|||
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) |
|||
{ |
|||
GameManager.Instance.player.influencePreviewPool[i].influenced = false; |
|||
} |
|||
GameManager.Instance.player.influencePreviewPool.Clear(); |
|||
//遍历影响池变色
|
|||
for (int i = 0; i < influencePreviewPool.Count; i++) |
|||
{ |
|||
influencePreviewPool[i].influenced = false; |
|||
} |
|||
influencePreviewPool.Clear(); |
|||
GetComponent<CanvasGroup>().blocksRaycasts = true; |
|||
|
|||
//其他位置都归位
|
|||
transform.SetParent(originalParent); |
|||
transform.localPosition = originalpoint; |
|||
return; |
|||
}//范围类,需要指定被影响的节点才能释放
|
|||
else |
|||
{ |
|||
//卡牌释放效果
|
|||
use(); |
|||
Debug.Log("玩家盾量:" + Usermanager.Instance.Shield); |
|||
|
|||
//临时效果--将其加入墓地并销毁实体
|
|||
TurnMaster.Instance.usedCard.usedCardList.Add(this.gameObject.GetComponent<CardEntity>().CardId); |
|||
Destroy(this.gameObject); |
|||
|
|||
return; |
|||
|
|||
}//无范围类,直接释放
|
|||
|
|||
} |
|||
else |
|||
{ |
|||
canUse = true; |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 155b54f5b89b3c34cbad23a01eac4128 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
interface EffectRangeHandler |
|||
{ |
|||
public List<MapUnity> HandleAngleWithResult(float angle) { return new List<MapUnity>(); } |
|||
} |
|||
@ -1,5 +1,5 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 7831439f6bbbdf14b8546fd1ac26d312 |
|||
guid: 69f7bbdc311a20f408557dcf8b3b6da1 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler1 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 00c6f2acf33d3594aa85dff634c0b326 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,57 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler2 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 6b9df673ab6b6654794ec44e60a21a68 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,72 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler3_1 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler3_1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[2])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2].unitPool[2]); |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[3])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3].unitPool[3]); |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[4])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4].unitPool[4]); |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[5])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5].unitPool[5]); |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[0])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0].unitPool[0]); |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[1])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1].unitPool[1]); |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e69d436df9e59ac43964a510d554896e |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,59 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler3_2 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler3_2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: f95992a268d811b4cb2e60f390074d4a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,60 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler3_3 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler3_3(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: cc1a3054db3c5684581b5f3a16ef05d2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,89 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler4_1 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler4_1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[2])) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[2].unitPool[2])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2].unitPool[2].unitPool[2]); |
|||
} |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[3])) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[3].unitPool[3])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3].unitPool[3].unitPool[3]); |
|||
} |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[4])) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[4].unitPool[4])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4].unitPool[4].unitPool[4]); |
|||
} |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[5])) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[5].unitPool[5])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5].unitPool[5].unitPool[5]); |
|||
} |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[0])) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[0].unitPool[0])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0].unitPool[0].unitPool[0]); |
|||
} |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
if(tryGetNodeInfluencedable(currentNode.unitPool[1])) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[1].unitPool[1])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1].unitPool[1].unitPool[1]); |
|||
} |
|||
}; |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c12b1b2739ddb4b4c84423bfce4e4fad |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,66 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler4_2 : EffectRangeHandlerBase |
|||
{ |
|||
// Start is called before the first frame update
|
|||
public EffectRangeHandler4_2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: fedc0bf313dccd0488a95a873c7d6d81 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,66 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler4_3 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler4_3(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c89eb1cca69e73448b432e97264487e5 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,71 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler5_1 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler5_1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,2); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,3); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,4); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,5); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,0); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,1); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
private void get5_1Node(MapUnity currentNode,int angle) |
|||
{ |
|||
MapUnity currentCheckNode= currentNode; |
|||
for (int i=0; i < 4; i++) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentCheckNode.unitPool[angle])) |
|||
{ |
|||
currentCheckNode= currentCheckNode.unitPool[angle]; |
|||
} |
|||
else |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: d12cd3aaefee0d84f995c3a3559fcc86 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,72 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler5_2 : EffectRangeHandlerBase |
|||
{ |
|||
|
|||
public EffectRangeHandler5_2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3]); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 94b4b09efbde8d24abc3872b4e44eaa3 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,95 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler5_3 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler5_3(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[0])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0].unitPool[0]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[4])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4].unitPool[4]); |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[1])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1].unitPool[1]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[5])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5].unitPool[5]); |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[2])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2].unitPool[2]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[0])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[0].unitPool[0]); |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[3])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3].unitPool[3]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[1])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[1].unitPool[1]); |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[4])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[4].unitPool[4]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[2])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[2].unitPool[2]); |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[5])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[5].unitPool[5]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[3])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[3].unitPool[3]); |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 6348d10811fd5604ead921e49aefd79f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,72 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler6_1 : EffectRangeHandlerBase |
|||
{ |
|||
|
|||
public EffectRangeHandler6_1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get6_1Node(currentNode,2); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get6_1Node(currentNode,3); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get6_1Node(currentNode,4); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get6_1Node(currentNode,5); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get6_1Node(currentNode,0); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get6_1Node(currentNode,1); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
private void get6_1Node(MapUnity currentNode, int angle) |
|||
{ |
|||
MapUnity currentCheckNode = currentNode; |
|||
for (int i = 0; i < 5; i++) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentCheckNode.unitPool[angle])) |
|||
{ |
|||
currentCheckNode = currentCheckNode.unitPool[angle]; |
|||
} |
|||
else |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 4673ba2234bcef54bbedbd3cab1bcc33 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,70 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler6_2 : EffectRangeHandlerBase |
|||
{ |
|||
|
|||
private ZeroToFiveCircularCounter counter=new ZeroToFiveCircularCounter(); |
|||
public EffectRangeHandler6_2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get6_2Node(currentNode,2); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get6_2Node(currentNode,3); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get6_2Node(currentNode,4); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get6_2Node(currentNode,5); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get6_2Node(currentNode,0); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get6_2Node(currentNode,1); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
private void get6_2Node(MapUnity currentNode,int value) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value,2)])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 2)].unitPool[value]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value,2)])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 2)].unitPool[value]); |
|||
} |
|||
tryGetNodeInfluencedable(currentNode.unitPool[value]); |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 44c1c0e6762966548ad8cbc42d735b26 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,61 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler6_3 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler6_3(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get6_3Node(currentNode); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get6_3Node(currentNode); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get6_3Node(currentNode); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get6_3Node(currentNode); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get6_3Node(currentNode); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get6_3Node(currentNode); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
private void get6_3Node(MapUnity currentNode) |
|||
{ |
|||
for (int i = 0; i < 6; i++) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[i]); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 0af6a30bba841b44ea5d916c03214257 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,70 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler7_1 : EffectRangeHandlerBase |
|||
{ |
|||
public EffectRangeHandler7_1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,2); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,3); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,4); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,5); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,0); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get5_1Node(currentNode,1); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
private void get5_1Node(MapUnity currentNode, int angle) |
|||
{ |
|||
MapUnity currentCheckNode = currentNode; |
|||
for (int i = 0; i < 6; i++) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentCheckNode.unitPool[angle])) |
|||
{ |
|||
currentCheckNode = currentCheckNode.unitPool[angle]; |
|||
} |
|||
else |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c6bbb05d3be151a4587f97878365269d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,87 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler7_2 : EffectRangeHandlerBase |
|||
{ |
|||
|
|||
private ZeroToFiveCircularCounter counter = new ZeroToFiveCircularCounter(); |
|||
public EffectRangeHandler7_2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get7_2Node(currentNode,2); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get7_2Node(currentNode,3); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get7_2Node(currentNode,4); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get7_2Node(currentNode,5); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get7_2Node(currentNode,0); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get7_2Node(currentNode,1); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
private void get7_2Node(MapUnity currentNode, int value) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)].unitPool[value]); |
|||
} |
|||
if (tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 1)])) |
|||
{ |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 1)].unitPool[value]); |
|||
} |
|||
getongNode(currentNode, value); |
|||
|
|||
} |
|||
|
|||
|
|||
private void getongNode(MapUnity currentNode, int angle) |
|||
{ |
|||
MapUnity currentCheckNode = currentNode; |
|||
for (int i = 0; i < 2; i++) |
|||
{ |
|||
if (tryGetNodeInfluencedable(currentCheckNode.unitPool[angle])) |
|||
{ |
|||
currentCheckNode = currentCheckNode.unitPool[angle]; |
|||
} |
|||
else |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: d35504d31c482e4469d49b8a79828a35 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,132 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler8_1 : EffectRangeHandler |
|||
{ |
|||
// Start is called before the first frame update
|
|||
public float Epsilon { get; } = 1.00f; |
|||
|
|||
private float euler; |
|||
|
|||
private MapUnity currentNode; |
|||
|
|||
public List<MapUnity> influencePreviewPool = new List<MapUnity>();//卡牌的影响范围
|
|||
|
|||
private readonly Dictionary<float, Func<List<MapUnity>>> angleActions; |
|||
|
|||
private ZeroToFiveCircularCounter counter = new ZeroToFiveCircularCounter(); |
|||
public EffectRangeHandler8_1(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
this.currentNode = currentNode; |
|||
this.euler = euler; |
|||
influencePreviewPool.Add(currentNode); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
ge8_1Node(currentNode,2); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
ge8_1Node(currentNode,3); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
ge8_1Node(currentNode,4); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
ge8_1Node(currentNode,5); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
ge8_1Node(currentNode,0); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
ge8_1Node(currentNode,1); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
public List<MapUnity> HandleAngleWithResult(float angle) |
|||
{ |
|||
foreach (var kvp in angleActions) |
|||
{ |
|||
if (Math.Abs(angle - kvp.Key) < Epsilon) |
|||
{ |
|||
return kvp.Value(); |
|||
} |
|||
} |
|||
return influencePreviewPool; |
|||
} |
|||
|
|||
public bool tryGetNodeInfluencedable(MapUnity currentNode) |
|||
{ |
|||
bool canPass = true; |
|||
if (currentNode == null) |
|||
{ |
|||
canPass = false; |
|||
return canPass; |
|||
} |
|||
//Debug.Log("坐标X"+currentNode.locationX+ "坐标Y" + currentNode.locationY);
|
|||
if (currentNode.TryGetComponent<EnemyNode>(out EnemyNode enemyNode)) |
|||
{ |
|||
Debug.Log("JJKK"); |
|||
if (enemyNode.enemyType == EnemyNode.EnemyType.block) |
|||
{ |
|||
Debug.Log("AABB"); |
|||
canPass = false; |
|||
influencePreviewPool.Add(currentNode); |
|||
} |
|||
Debug.Log("DDFF"); |
|||
} |
|||
|
|||
if (canPass) |
|||
{ |
|||
influencePreviewPool.Add(currentNode); |
|||
} |
|||
return canPass; |
|||
} |
|||
|
|||
private void ge8_1Node(MapUnity currentNode, int value) |
|||
{ |
|||
try |
|||
{ |
|||
|
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 2)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 2)].unitPool[counter.Subtract(value, 2)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 2)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 2)].unitPool[counter.Add(value, 2)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[value]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[value].unitPool[counter.Subtract(value, 2)].unitPool[counter.Subtract(value, 2)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 1)]); |
|||
tryGetNodeInfluencedable(currentNode.unitPool[value].unitPool[counter.Add(value, 2)].unitPool[counter.Add(value, 2)]); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
//nothing to do
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: d0ecdbe96d2d1ec45b7d51b5ea18cd06 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,118 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using TreeEditor; |
|||
using UnityEditor.Experimental.GraphView; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandler8_2 : EffectRangeHandlerBase |
|||
{ |
|||
|
|||
public EffectRangeHandler8_2(MapUnity currentNode, float euler) |
|||
{ |
|||
influencePreviewPool.Clear(); |
|||
angleActions = new Dictionary<float, Func<List<MapUnity>>> |
|||
{ |
|||
{ 30.0f, () => |
|||
{ |
|||
get8_2Node(currentNode,influencePreviewPool); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 90.0f, () => |
|||
{ |
|||
get8_2Node(currentNode,influencePreviewPool); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 150.0f, () => |
|||
{ |
|||
get8_2Node(currentNode,influencePreviewPool); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 210.0f, () => |
|||
{ |
|||
get8_2Node(currentNode,influencePreviewPool); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 270.0f, () => |
|||
{ |
|||
get8_2Node(currentNode,influencePreviewPool); |
|||
return influencePreviewPool; |
|||
} |
|||
}, |
|||
{ 330.0f, () => |
|||
{ |
|||
get8_2Node(currentNode,influencePreviewPool); |
|||
return influencePreviewPool; |
|||
} |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
|
|||
public bool tryGetNodeInfluencedableList(MapUnity node,List<MapUnity> nodeList) |
|||
{ |
|||
bool canPass = true; |
|||
if (node == null) |
|||
{ |
|||
canPass = false; |
|||
return canPass; |
|||
} |
|||
Debug.Log("坐标X" + node.locationX + "坐标Y" + node.locationY); |
|||
if (node.TryGetComponent<EnemyNode>(out EnemyNode enemyNode)) |
|||
{ |
|||
Debug.Log("JJKK"); |
|||
if (enemyNode.enemyType == EnemyNode.EnemyType.block) |
|||
{ |
|||
Debug.Log("AABB"); |
|||
canPass = false; |
|||
nodeList.Add(node); |
|||
} |
|||
Debug.Log("DDFF"); |
|||
} |
|||
|
|||
if (canPass) |
|||
{ |
|||
nodeList.Add(node); |
|||
} |
|||
return canPass; |
|||
} |
|||
|
|||
|
|||
private void get8_2Node(MapUnity node, List<MapUnity> influencePreviewPool) |
|||
{ |
|||
influencePreviewPool.Add(node); |
|||
getNearbyNode(influencePreviewPool); |
|||
getNearbyNode(influencePreviewPool); |
|||
getNearbyNode(influencePreviewPool); |
|||
while (influencePreviewPool.Contains(node)) |
|||
{ |
|||
influencePreviewPool.Remove(node); |
|||
} |
|||
} |
|||
|
|||
public void getNearbyNode(List<MapUnity> nodeList) |
|||
{ |
|||
// 创建一个副本以避免遍历时修改原集合
|
|||
List<MapUnity> nodesCopy = new List<MapUnity>(nodeList); |
|||
List<MapUnity> nodesToAdd = new List<MapUnity>(); // 临时列表存储要添加的节点
|
|||
|
|||
foreach (var node in nodesCopy) |
|||
{ |
|||
for (int i = 0; i < 6; i++) |
|||
{ |
|||
tryGetNodeInfluencedableList(node.unitPool[i], nodesToAdd); |
|||
} |
|||
} |
|||
|
|||
// 遍历完成后统一修改原集合
|
|||
nodeList.AddRange(nodesToAdd); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 59788a2dffefa7d46a9fb6dc213ce6f4 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,59 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRangeHandlerBase : EffectRangeHandler |
|||
{ |
|||
public List<MapUnity> influencePreviewPool = new List<MapUnity>();//卡牌的影响范围
|
|||
|
|||
public Dictionary<float, Func<List<MapUnity>>> angleActions; |
|||
|
|||
public float Epsilon { get; } = 1.00f; |
|||
public bool tryGetNodeInfluencedable(MapUnity currentNode) |
|||
{ |
|||
bool canPass = true; |
|||
if (currentNode == null) |
|||
{ |
|||
canPass = false; |
|||
return canPass; |
|||
} |
|||
Debug.Log("currentNode"+ currentNode.enemyNode); |
|||
/*if (currentNode.TryGetComponent<EnemyNode>(out EnemyNode enemyNode))*/ |
|||
if (currentNode.enemyNode!=null) |
|||
{ |
|||
Debug.Log("JJKK"); |
|||
if (currentNode.enemyNode.enemyType.Equals(EnemyNode.EnemyType.block)) |
|||
{ |
|||
Debug.Log("AABB"); |
|||
canPass = false; |
|||
influencePreviewPool.Add(currentNode); |
|||
} |
|||
Debug.Log("DDFF"); |
|||
} |
|||
|
|||
if (canPass) |
|||
{ |
|||
influencePreviewPool.Add(currentNode); |
|||
} |
|||
return canPass; |
|||
} |
|||
|
|||
public List<MapUnity> HandleAngleWithResult(float angle) |
|||
{ |
|||
Debug.Log("角度大小" + angle); |
|||
foreach (var kvp in angleActions) |
|||
{ |
|||
if (Math.Abs(angle - kvp.Key) < Epsilon) |
|||
{ |
|||
return kvp.Value(); |
|||
} |
|||
} |
|||
Debug.Log("数组大小" + influencePreviewPool.Count); |
|||
return influencePreviewPool; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: a0ccdd1cbd5c03747afb096b65d7783f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,43 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class EffectRange |
|||
{ |
|||
|
|||
public const string range1 = "1"; |
|||
|
|||
public const string range2 = "2"; |
|||
|
|||
public const string range3_1 = "3_1"; |
|||
|
|||
public const string range3_2 = "3_2"; |
|||
|
|||
public const string range3_3 = "3_3"; |
|||
|
|||
public const string range4_1 = "4_1"; |
|||
|
|||
public const string range4_2 = "4_2"; |
|||
|
|||
public const string range4_3 = "4_3"; |
|||
|
|||
public const string range5_1 = "5_1"; |
|||
|
|||
public const string range5_2 = "5_2"; |
|||
|
|||
public const string range5_3 = "5_3"; |
|||
|
|||
public const string range6_1 = "6_1"; |
|||
|
|||
public const string range6_2 = "6_2"; |
|||
|
|||
public const string range6_3 = "6_3"; |
|||
|
|||
public const string range7_1 = "7_1"; |
|||
|
|||
public const string range7_2 = "7_2"; |
|||
|
|||
public const string range8_1 = "8_1"; |
|||
|
|||
public const string range8_2 = "8_2"; |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: beb3d35a6756bdc459d31108282df2a2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,29 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class ZeroToFiveCircularCounter |
|||
{ |
|||
private const int MinValue = 0; |
|||
private const int MaxValue = 5; |
|||
|
|||
public int Add(int currentValue, int increment) |
|||
{ |
|||
int newValue = (currentValue + increment) % (MaxValue + 1); |
|||
if (newValue < MinValue) |
|||
{ |
|||
newValue += (MaxValue + 1); |
|||
} |
|||
return newValue; |
|||
} |
|||
|
|||
public int Subtract(int currentValue, int decrement) |
|||
{ |
|||
int newValue = (currentValue - decrement) % (MaxValue + 1); |
|||
if (newValue < MinValue) |
|||
{ |
|||
newValue += (MaxValue + 1); |
|||
} |
|||
return newValue; |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ff9f8714584c75946a30602d0511fca7 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,27 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class getNodeTools |
|||
{ |
|||
public bool tryGetNodeInfluencedable(MapUnity currentNode,List<MapUnity> nodeList) |
|||
{ |
|||
bool canPass = true; |
|||
if (currentNode == null) |
|||
{ |
|||
canPass = false; |
|||
} |
|||
else if (currentNode.blocked) |
|||
{ |
|||
canPass = false; |
|||
} |
|||
if (canPass) |
|||
{ |
|||
nodeList.Add(currentNode); |
|||
} |
|||
|
|||
return canPass; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 13d755d44d63f5842b225090d3280e7f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,41 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class MapUnityManager : MonoBehaviour |
|||
{ |
|||
public List<MapUnity> findReachableTiles(MapUnity startNode, int movePoints) |
|||
{ |
|||
List<MapUnity> reachableNodes = new List<MapUnity>(); |
|||
Queue<MapUnity> queue = new Queue<MapUnity>(); |
|||
Dictionary<MapUnity, int> remainingMovePoints = new Dictionary<MapUnity, int>(); |
|||
|
|||
queue.Enqueue(startNode); |
|||
remainingMovePoints[startNode] = movePoints; |
|||
|
|||
while (queue.Count > 0) |
|||
{ |
|||
MapUnity currentNode = queue.Dequeue(); |
|||
int currentMovePoints = remainingMovePoints[currentNode]; |
|||
|
|||
foreach (MapUnity neighbor in currentNode.unitPool) |
|||
{ |
|||
if (neighbor == null || neighbor.blocked || remainingMovePoints.ContainsKey(neighbor)) |
|||
continue; |
|||
|
|||
int newMovePoints = currentMovePoints - 1; // 每移动一格,减少一点移动点数
|
|||
|
|||
if (newMovePoints >= 0) |
|||
{ |
|||
queue.Enqueue(neighbor); |
|||
remainingMovePoints[neighbor] = newMovePoints; |
|||
reachableNodes.Add(neighbor); |
|||
} |
|||
} |
|||
} |
|||
|
|||
//遍历影响池变色
|
|||
|
|||
return reachableNodes; |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: d344126aa8082fa48b7e5f19eff09202 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
|
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 556 B |
|
Before Width: | Height: | Size: 556 B |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
@ -1,10 +1,10 @@ |
|||
{ "pid": 35942, "tid": -1, "ph": "M", "name": "process_name", "args": { "name": "netcorerun.dll" } }, |
|||
{ "pid": 35942, "tid": -1, "ph": "M", "name": "process_sort_index", "args": { "sort_index": "-1" } }, |
|||
{ "pid": 35942, "tid": 1, "ph": "M", "name": "thread_name", "args": { "name": "" } }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357171611, "dur": 403588, "ph": "X", "name": "BuildProgram", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357172744, "dur": 60187, "ph": "X", "name": "BuildProgramContextConstructor", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357514285, "dur": 4444, "ph": "X", "name": "OutputData.Write", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357518732, "dur": 56452, "ph": "X", "name": "Backend.Write", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357520315, "dur": 39403, "ph": "X", "name": "JsonToString", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357582541, "dur": 1383, "ph": "X", "name": "", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719206357582037, "dur": 2124, "ph": "X", "name": "Write chrome-trace events", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762152585, "dur": 551718, "ph": "X", "name": "BuildProgram", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762153899, "dur": 77303, "ph": "X", "name": "BuildProgramContextConstructor", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762602520, "dur": 9962, "ph": "X", "name": "OutputData.Write", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762612494, "dur": 91798, "ph": "X", "name": "Backend.Write", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762616776, "dur": 68294, "ph": "X", "name": "JsonToString", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762713865, "dur": 1776, "ph": "X", "name": "", "args": {} }, |
|||
{ "pid": 35942, "tid": 1, "ts": 1719560762713305, "dur": 2724, "ph": "X", "name": "Write chrome-trace events", "args": {} }, |
|||
|
|||