ai前存档
This commit is contained in:
@@ -114,8 +114,9 @@ public class MonsterContral : MonoBehaviour
|
||||
/// <summary>主相机缓存</summary>
|
||||
protected Camera mainCamera;
|
||||
|
||||
public List<Transform> colliderList;
|
||||
|
||||
|
||||
|
||||
|
||||
// ================================================================
|
||||
// Unity 生命周期
|
||||
@@ -213,15 +214,8 @@ public class MonsterContral : MonoBehaviour
|
||||
}
|
||||
public IEnumerator yanchi(GameObject obj,float time, bool isyuzhen)
|
||||
{
|
||||
if (isyuzhen)
|
||||
{
|
||||
Debug.Log($"[MonsterContral] 鱼阵 {yzID} 路线结束,等待 {time} 秒后销毁"+ guid);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(time);
|
||||
if (isyuzhen)
|
||||
{
|
||||
Debug.Log($"[MonsterContral] 鱼阵 {yzID} 路线结束,销毁对象" + guid);
|
||||
}
|
||||
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
|
||||
|
||||
}
|
||||
@@ -352,34 +346,40 @@ public class MonsterContral : MonoBehaviour
|
||||
/// <param name="nextPos">下一帧目标位置</param>
|
||||
private void ApplyFacingDirection(Vector2 nextPos)
|
||||
{
|
||||
if (!isRotate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Vector2 toNext = nextPos - (Vector2)transform.position;
|
||||
Vector2 fromNext = (Vector2)transform.position - nextPos;
|
||||
if (!isRotate) return;
|
||||
|
||||
Vector2 toNext = nextPos - (Vector2)transform.position;
|
||||
|
||||
if (toNext.sqrMagnitude < 0.0001f) return; // 避免零向量
|
||||
|
||||
if (string.IsNullOrEmpty(forwordXYZ))
|
||||
{
|
||||
// 默认:2D 用 up,3D 用 forward
|
||||
if (!is3D)
|
||||
transform.up = fromNext.normalized;
|
||||
{
|
||||
// 2D 用 up,推荐用 Quaternion.AngleAxis
|
||||
float angle = Mathf.Atan2(toNext.y, toNext.x) * Mathf.Rad2Deg;
|
||||
transform.rotation = Quaternion.AngleAxis(angle - 90f, Vector3.forward);
|
||||
}
|
||||
else
|
||||
transform.forward = toNext.normalized;
|
||||
{
|
||||
// 3D 用 forward,推荐用 LookRotation
|
||||
transform.rotation = Quaternion.LookRotation(toNext.normalized, Vector3.up);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch (forwordXYZ)
|
||||
{
|
||||
case "X": transform.right = toNext.normalized; break;
|
||||
case "-X": transform.right = fromNext.normalized; break;
|
||||
case "Y": transform.up = toNext.normalized; break;
|
||||
case "-Y": transform.up = fromNext.normalized; break;
|
||||
case "Z": transform.forward = toNext.normalized; break;
|
||||
case "-Z": transform.forward = fromNext.normalized; break;
|
||||
case "X": transform.right = toNext.normalized; break;
|
||||
case "-X": transform.right = -toNext.normalized; break;
|
||||
case "Y": transform.up = toNext.normalized; break;
|
||||
case "-Y": transform.up = -toNext.normalized; break;
|
||||
case "Z": transform.forward = toNext.normalized; break;
|
||||
case "-Z": transform.forward = -toNext.normalized; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ================================================================
|
||||
// 动画
|
||||
// ================================================================
|
||||
|
||||
@@ -25,6 +25,7 @@ public class MonsterControl_BossBase : MonsterContral
|
||||
public Action<int> JiaFen;
|
||||
public List<List<RedPacketRecord>> redPacketRecords = new List<List<RedPacketRecord>>();
|
||||
public Camera ZhuCam;
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
@@ -3,6 +3,7 @@ using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -19,6 +20,7 @@ public class BullitMove : MonoBehaviour
|
||||
Vector3 vector3_startPosition;
|
||||
public bool isTriggerFirst = true;
|
||||
MonsterContral target;
|
||||
public Transform targetTra;
|
||||
public string bulletID;
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
@@ -27,7 +29,7 @@ public class BullitMove : MonoBehaviour
|
||||
//Destroy(gameObject, desTime);
|
||||
}
|
||||
bool isLock = false;
|
||||
public void Lock(MonsterContral monsterContral)
|
||||
public void Lock(MonsterContral monsterContral,Transform endTra)
|
||||
{
|
||||
foreach (var item in GetComponents<Collider2D>())
|
||||
{
|
||||
@@ -35,6 +37,7 @@ public class BullitMove : MonoBehaviour
|
||||
}
|
||||
isLock = true;
|
||||
target = monsterContral;
|
||||
targetTra = endTra;
|
||||
}
|
||||
public void NotLock()
|
||||
{
|
||||
@@ -51,9 +54,13 @@ public class BullitMove : MonoBehaviour
|
||||
public void Init()
|
||||
{
|
||||
vector3_startPosition = transform.position;
|
||||
vector3_startPosition.z = -400;
|
||||
transform.position = vector3_startPosition;
|
||||
}
|
||||
//子弹同步分为两种一种是锁定目标一种是不锁定目标
|
||||
// Update is called once per frame
|
||||
float ABdistanceTemp=999999999;
|
||||
public float a = 0.1f;
|
||||
void Update()
|
||||
{
|
||||
if (isLock)
|
||||
@@ -62,24 +69,35 @@ public class BullitMove : MonoBehaviour
|
||||
{
|
||||
NotLock();
|
||||
}
|
||||
var ABdistance = Vector3.Distance(transform.position, target.transform.position);
|
||||
var rotateSpeed = 1/ABdistance;
|
||||
Vector3 targetPoint = (target.transform.position-transform.position).normalized * moveSpeed*Time.deltaTime;
|
||||
transform.up = Vector3.Lerp(transform.up, targetPoint, rotateSpeed);
|
||||
Vector3 v3bullet = transform.position;
|
||||
v3bullet.z = 0;
|
||||
Vector3 v3target = targetTra.transform.position;
|
||||
v3target.z = 0;
|
||||
var ABdistance = Vector3.Distance(v3bullet, v3target);
|
||||
var rotateSpeed = 1/(ABdistance/3);
|
||||
Vector3 targetPoint = (targetTra.transform.position-transform.position).normalized * moveSpeed*Time.deltaTime;
|
||||
targetPoint.z = transform.position.z;
|
||||
//transform.up = Vector2.Lerp(transform.up, targetPoint, rotateSpeed);
|
||||
transform.up = Vector2.Lerp(transform.up, targetPoint, a);
|
||||
targetPoint = transform.up.normalized * moveSpeed * Time.deltaTime;
|
||||
targetPoint.z = 0;
|
||||
transform.position+= targetPoint;
|
||||
if (ABdistance <= 2)
|
||||
|
||||
//if (ABdistance <= 2)
|
||||
if (ABdistance > ABdistanceTemp)
|
||||
{
|
||||
AttackFish(target);
|
||||
}
|
||||
|
||||
ABdistanceTemp = ABdistance;
|
||||
}
|
||||
else
|
||||
{
|
||||
//方便帧同步
|
||||
currShowTime += Time.deltaTime;
|
||||
Vector3 targetPoint = transform.up.normalized * currShowTime * moveSpeed;
|
||||
targetPoint.z = 0;
|
||||
transform.position = vector3_startPosition + targetPoint;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -176,13 +194,15 @@ public class BullitMove : MonoBehaviour
|
||||
var v2 = GameManager.Instance.gameData.currRoomData;
|
||||
if (true)
|
||||
{
|
||||
WebSocketSendList.KillFish(v2.roomId, userid,monster.monsterData.fishTypeConfig.fishNumber, monster.guid, (int)CreateFishManager.Instance.currGameType.currSitData.consumeGoldNum);
|
||||
//WebSocketSendList.KillFish(v2.roomId, userid,monster.monsterData.fishTypeConfig.fishNumber, monster.guid, (int)CreateFishManager.Instance.currGameType.currSitData.consumeGoldNum);
|
||||
WebSocketSendList.KillFish(v2.roomId, userid, monster.monsterData.fishTypeConfig.fishNumber, monster.guid, (int)CreateFishManager.Instance.currGameType.currSitData.consumeGoldNum, bulletID, "63215f0afa3f5b25");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//受激
|
||||
|
||||
|
||||
//monster.monsterData.charactersHealth.OnHurt(10, CharacterHurtType.none);
|
||||
//monster.HP--;
|
||||
//if (monster.HP == 0)
|
||||
|
||||
@@ -610,7 +610,13 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
//bossTimer = 3f;
|
||||
if (!fishTypeConfig.TryGetValue(FishTypeEnum.Boss鱼, out var bossList) || bossList.Count == 0)
|
||||
return;
|
||||
|
||||
//foreach (var item in bossList)
|
||||
//{
|
||||
// if (item.fishNumber == "13030")
|
||||
// {
|
||||
// item.isCreate = 2;
|
||||
// }
|
||||
//}
|
||||
|
||||
StartCoroutine(buchongfu(bossList, bossCount));
|
||||
|
||||
@@ -675,7 +681,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
foreach (var cfg in candidates)
|
||||
{
|
||||
randWeight -= cfg.fishWeight;
|
||||
if (randWeight <= 0) // 注意这里是 <= 0
|
||||
if (randWeight < 0) // 注意这里是 <= 0
|
||||
{
|
||||
chosen = cfg;
|
||||
break;
|
||||
|
||||
@@ -18,7 +18,9 @@ namespace Assets.MyGame.Scripts.Net
|
||||
public static Dictionary<APIType, string> dic_API = new Dictionary<APIType, string>();
|
||||
//public const string baseURL = "http://game5241.wzaxr.top";
|
||||
#if UNITY_EDITOR
|
||||
public const string baseURL = "http://8.137.163.153";
|
||||
//public const string baseURL = "http://8.137.163.153";
|
||||
public const string baseURL = "http://8.137.8.46";
|
||||
|
||||
#else
|
||||
public const string baseURL = "http://8.137.8.46";
|
||||
|
||||
|
||||
@@ -25,12 +25,13 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
|
||||
/// 获得金币
|
||||
/// </summary>
|
||||
public int gold;
|
||||
public int beishu;
|
||||
|
||||
/// <summary>
|
||||
/// 鱼的唯一实例 ID
|
||||
/// </summary>
|
||||
public string fishId;
|
||||
public int timespan;
|
||||
public long timespan;
|
||||
public int killtime;
|
||||
public string msg;
|
||||
public JObject param;
|
||||
|
||||
@@ -51,6 +51,15 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
|
||||
changeTurret=7
|
||||
|
||||
}
|
||||
[Serializable]
|
||||
public class FireCannonSendData
|
||||
{
|
||||
public string userId;
|
||||
public List<string> bulletIds;
|
||||
public long gold;
|
||||
public int count;
|
||||
public SyncGameData extra;
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步游戏数据
|
||||
/// </summary>
|
||||
@@ -95,8 +104,8 @@ namespace Assets.MyGame.Scripts.Net.WebResponses
|
||||
[Serializable]
|
||||
public class FrameData_ChangeAutoTarget : FrameData
|
||||
{
|
||||
public string targetGuid;
|
||||
public string targetPostName;
|
||||
public List< string> targetGuid;
|
||||
public int colliderIndex;
|
||||
}
|
||||
[Serializable]
|
||||
public class FrameData_RandomDieFish : FrameData
|
||||
|
||||
@@ -25,7 +25,9 @@ namespace Assets.MyGame.Scripts.Net
|
||||
|
||||
//private const string baseUrl = "ws://game5241.wzaxr.top";
|
||||
#if UNITY_EDITOR
|
||||
private const string baseUrl = "ws://8.137.163.153";
|
||||
//private const string baseUrl = "ws://8.137.163.153";
|
||||
private const string baseUrl = "ws://8.137.8.46";
|
||||
|
||||
#else
|
||||
private const string baseUrl = "ws://8.137.8.46";
|
||||
#endif
|
||||
|
||||
@@ -265,6 +265,7 @@ namespace Assets.MyGame.Scripts.Net
|
||||
case MessageType.Invocation:
|
||||
switch (v.target)
|
||||
{
|
||||
|
||||
case "GetRoomListResult":
|
||||
//UIManager.Instance.Get<UIHome_BY_SelectRoomLevelPanel>(UIPanel.SelectRoomPenel);
|
||||
WebSocketReponseList.GetRoomListResult(msg);
|
||||
@@ -275,6 +276,10 @@ namespace Assets.MyGame.Scripts.Net
|
||||
break;
|
||||
case "RoomInfo":
|
||||
WebSocketReponseList.RoomInfo(msg);
|
||||
break;
|
||||
case "RoomFireNotice":
|
||||
WebSocketReponseList.RoomFireNotice(msg);
|
||||
|
||||
break;
|
||||
case "RoomKillNotice":
|
||||
WebSocketReponseList.RoomKillNotice(msg);
|
||||
|
||||
@@ -132,6 +132,14 @@ namespace Assets.MyGame.Scripts.Net
|
||||
{
|
||||
CreateFishManager.Instance.Ws_DieFish(msg);
|
||||
}
|
||||
public static void RoomFireNotice(string msg)
|
||||
{
|
||||
FireCannonSendData fireCannonSendData = JsonConvert.DeserializeObject<WebSocketResponseBase<FireCannonSendData>>(msg).arguments[0];
|
||||
var syncGameData = fireCannonSendData.extra;
|
||||
|
||||
EventCenter.Instance.EventTrigger<FireCannonSendData>(ConstEventString.SyncGameData_FireBullet, fireCannonSendData);
|
||||
}
|
||||
|
||||
public static void SyncPlayerGold(string msg)
|
||||
{
|
||||
var gold = JsonConvert.DeserializeObject<WebSocketResponseBase<long>>(msg).arguments[0];
|
||||
@@ -141,6 +149,7 @@ namespace Assets.MyGame.Scripts.Net
|
||||
break;
|
||||
case GameType.defaultPanel:
|
||||
UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelDefault).currSitData.goldNum = gold;
|
||||
|
||||
break;
|
||||
case GameType.FLZY:
|
||||
UIManager.Instance.Get<GameMainPanel_FishBase>(UIPanel.MainGamePanelFLZY).currSitData.goldNum = gold;
|
||||
@@ -182,7 +191,7 @@ namespace Assets.MyGame.Scripts.Net
|
||||
EventCenter.Instance.EventTrigger<SyncGameData>(ConstEventString.SyncGameData_Rotate, syncGameData);
|
||||
break;
|
||||
case FrameDataType.fireBullet:
|
||||
EventCenter.Instance.EventTrigger<SyncGameData>(ConstEventString.SyncGameData_FireBullet, syncGameData);
|
||||
//EventCenter.Instance.EventTrigger<SyncGameData>(ConstEventString.SyncGameData_FireBullet, syncGameData);
|
||||
break;
|
||||
case FrameDataType.createFish:
|
||||
EventCenter.Instance.EventTrigger<SyncGameData>(ConstEventString.SyncGameData_CreateFish, syncGameData);
|
||||
|
||||
@@ -1,11 +1,58 @@
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses.ChineseChess;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Text;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public partial class WebSocketSendList
|
||||
{
|
||||
public static string MakeKillFishSign(
|
||||
string roomId,
|
||||
string userId,
|
||||
string fishNumber,
|
||||
string fishId,
|
||||
long gold,
|
||||
long timespan,
|
||||
string bulletId,
|
||||
long timestamp,
|
||||
string signKey
|
||||
)
|
||||
{
|
||||
string rawStr = $"{roomId}|{userId}|{fishNumber}|{fishId}|{gold}|{timespan}|{bulletId}|{timestamp}";
|
||||
return Sign(rawStr, signKey);
|
||||
}
|
||||
|
||||
public static string MakeFireCannonSign(string roomId, string userId, long gold, int count, long timestamp, string signKey)
|
||||
{
|
||||
string rawStr = $"{roomId}|{userId}|{gold}|{count}|{timestamp}";
|
||||
Debug.Log($"生成签名的原始字符串:{rawStr}");
|
||||
return Sign(rawStr, signKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string Sign(string rawStr, string signKey)
|
||||
{
|
||||
string input = rawStr + "|" + signKey;
|
||||
|
||||
using (var md5 = System.Security.Cryptography.MD5.Create())
|
||||
{
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(input);
|
||||
byte[] hash = md5.ComputeHash(bytes);
|
||||
|
||||
// 转成 hex 字符串(前 8 位)
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < hash.Length; i++)
|
||||
{
|
||||
sb.Append(hash[i].ToString("x2"));
|
||||
}
|
||||
|
||||
return sb.ToString().Substring(0, 8);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取房间信息
|
||||
/// </summary>
|
||||
@@ -13,7 +60,7 @@ public partial class WebSocketSendList
|
||||
{
|
||||
WebSocketManager.Instance.Send(SocketType.room, "{\"type\":1,\"target\":\"GetRoomList\",\"invocationId\":\"1\",\"arguments\":[\"" + GameManager.Instance.user.id + "\"," + (int)GameManager.Instance.gameData.currGameType + "," + leave + ","+ district + "]}");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 打中鱼
|
||||
/// </summary>
|
||||
@@ -21,11 +68,76 @@ public partial class WebSocketSendList
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="fishNumber">配置id</param>
|
||||
/// <param name="fishId">唯一id</param>
|
||||
public static void KillFish(string roomId, string userId, string fishNumber, string fishId,int paoBei)
|
||||
public static void KillFish(
|
||||
string roomId,
|
||||
string userId,
|
||||
string fishNumber,
|
||||
string fishId,
|
||||
int paoBei,
|
||||
string bulletId,
|
||||
string signKey
|
||||
)
|
||||
{
|
||||
var sendObj = new WebSocketSendList("KillFish", roomId, userId, fishNumber, fishId, paoBei, DateTimeOffset.UtcNow.ToUnixTimeSeconds());
|
||||
long timespan = BeijingTimeManager.Instance.CurrentTimestampMs; // 毫秒
|
||||
long timestamp = timespan / 1000; // 秒级
|
||||
|
||||
// count 固定为 1
|
||||
string sign = MakeKillFishSign(roomId, userId, fishNumber, fishId, paoBei, timespan, bulletId, timestamp, signKey);
|
||||
|
||||
var sendObj = new WebSocketSendList(
|
||||
"KillFish",
|
||||
roomId,
|
||||
userId,
|
||||
fishNumber,
|
||||
fishId,
|
||||
paoBei,
|
||||
timespan,
|
||||
bulletId,
|
||||
timestamp,
|
||||
sign
|
||||
);
|
||||
|
||||
WebSocketManager.Instance.Send(SocketType.game, JsonConvert.SerializeObject(sendObj));
|
||||
}
|
||||
/// <summary>
|
||||
/// 发射子弹
|
||||
/// </summary>
|
||||
/// <param name="roomId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="gold">单价</param>
|
||||
/// <param name="count">数量</param>
|
||||
/// <summary>
|
||||
/// 发射子弹(与 KillFish 同结构版本)
|
||||
/// </summary>
|
||||
public static void FireCannon(
|
||||
string roomId,
|
||||
string userId,
|
||||
long gold,
|
||||
int count,
|
||||
object extra,
|
||||
string signKey
|
||||
)
|
||||
{
|
||||
long timespan = BeijingTimeManager.Instance.CurrentTimestampMs; // 毫秒
|
||||
long timestamp = timespan / 1000; // 秒级
|
||||
|
||||
// FireCannon 的签名规则与 KillFish 一样:roomId|userId|gold|count|timestamp
|
||||
string sign = MakeFireCannonSign(roomId, userId, gold, count, timestamp, signKey);
|
||||
|
||||
var sendObj = new WebSocketSendList(
|
||||
"FireCannon",
|
||||
roomId,
|
||||
userId,
|
||||
gold,
|
||||
count,
|
||||
timestamp,
|
||||
sign,
|
||||
extra
|
||||
);
|
||||
|
||||
WebSocketManager.Instance.Send(SocketType.game, JsonConvert.SerializeObject(sendObj));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发射子弹
|
||||
/// </summary>
|
||||
|
||||
@@ -265,6 +265,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SitPosData : MonoBehaviour
|
||||
@@ -322,14 +323,14 @@ public class SitPosData : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
btn_TurretAdd.onClick.AddListener(() => ChangeTurretAddConsumeNum());
|
||||
btn_TurretMinus.onClick.AddListener(() => ChangeTurretMinusConsumeNum());
|
||||
// 构建字典
|
||||
dic_Turrets = list_Turrets.ToDictionary(t => t.turretID);
|
||||
|
||||
// 炮台倍率按钮
|
||||
btn_TurretAdd.onClick.AddListener(() => ChangeTurretAddConsumeNum(1000));
|
||||
btn_TurretMinus.onClick.AddListener(() => ChangeTurretMinusConsumeNum(1000));
|
||||
}
|
||||
|
||||
}
|
||||
// -------------------------
|
||||
// 切换炮台
|
||||
// -------------------------
|
||||
@@ -347,7 +348,7 @@ public class SitPosData : MonoBehaviour
|
||||
currentTurretID = currentTurret.turretID;
|
||||
currentTurret.gameObject.SetActive(true);
|
||||
|
||||
// 绑定状态机入口
|
||||
// 绑定状态机入口
|
||||
OnStateChange = currentTurret.ChangeState;
|
||||
|
||||
// 缓存旋转点
|
||||
@@ -400,16 +401,34 @@ public class SitPosData : MonoBehaviour
|
||||
tMP_GoldNum.text = goldNum.ToString();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ChangeTurretAddConsumeNum(int n)
|
||||
int indexConsume=0;
|
||||
public void ChangeTurretAddConsumeNum()
|
||||
{
|
||||
consumeGoldNum += n;
|
||||
if (CreateFishManager.Instance.currGameType.paoBeiList.Count-1> indexConsume)
|
||||
{
|
||||
indexConsume++;
|
||||
}
|
||||
else
|
||||
{
|
||||
indexConsume = 0;
|
||||
}
|
||||
|
||||
consumeGoldNum = CreateFishManager.Instance.currGameType.paoBeiList[indexConsume];
|
||||
tMP_TurretConsumeNum.text = consumeGoldNum.ToString();
|
||||
}
|
||||
|
||||
public void ChangeTurretMinusConsumeNum(int n)
|
||||
public void ChangeTurretMinusConsumeNum()
|
||||
{
|
||||
consumeGoldNum -= n;
|
||||
|
||||
if (indexConsume>0)
|
||||
{
|
||||
indexConsume--;
|
||||
}
|
||||
else
|
||||
{
|
||||
indexConsume = CreateFishManager.Instance.currGameType.paoBeiList.Count - 1;
|
||||
}
|
||||
consumeGoldNum = CreateFishManager.Instance.currGameType.paoBeiList[indexConsume];
|
||||
tMP_TurretConsumeNum.text = consumeGoldNum.ToString();
|
||||
}
|
||||
|
||||
@@ -432,6 +451,7 @@ public class SitPosData : MonoBehaviour
|
||||
isLock = false;
|
||||
|
||||
lockFX.SetActive(false);
|
||||
ChangeState(TurretState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ public class TurretData : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (setPosData != null)
|
||||
setPosData.OnStateChange = ChangeState;
|
||||
//if (setPosData != null)
|
||||
// setPosData.OnStateChange = ChangeState;
|
||||
|
||||
// 自动判断:如果狂暴攻击动画名不为空,就启用切换动画模式
|
||||
useFrenzyAnim = !string.IsNullOrEmpty(frenzyAttackAnim);
|
||||
|
||||
Reference in New Issue
Block a user