diff --git a/Assets/AddressableAssetsData/Windows/addressables_content_state.bin b/Assets/AddressableAssetsData/Windows/addressables_content_state.bin
index 0dc0048f6..0c657bd6f 100644
Binary files a/Assets/AddressableAssetsData/Windows/addressables_content_state.bin and b/Assets/AddressableAssetsData/Windows/addressables_content_state.bin differ
diff --git a/Assets/Framework/Tool/AnimMapBaker/Script/AnimMapBaker.cs b/Assets/Framework/Tool/AnimMapBaker/Script/AnimMapBaker.cs
new file mode 100644
index 000000000..f58e2b20a
--- /dev/null
+++ b/Assets/Framework/Tool/AnimMapBaker/Script/AnimMapBaker.cs
@@ -0,0 +1,211 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+using System.Linq;
+using System.IO;
+using System.Threading.Tasks;
+
+///
+/// 保存需要烘焙的动画的相关数据
+///
+public struct AnimData
+{
+ #region 字段
+
+ public int vertexCount;
+ public int mapWidth;
+ public List animClips;
+ public string name;
+
+ private Animation animation;
+ private SkinnedMeshRenderer skin;
+
+ #endregion
+
+ public AnimData(Animation anim, SkinnedMeshRenderer smr, string goName)
+ {
+ vertexCount = smr.sharedMesh.vertexCount;
+ mapWidth = Mathf.NextPowerOfTwo(vertexCount);
+ animClips = new List(anim.Cast());
+ animation = anim;
+ skin = smr;
+ name = goName;
+ }
+
+ #region 方法
+
+ public void AnimationPlay(string animName)
+ {
+ this.animation.Play(animName);
+ }
+
+ public void SampleAnimAndBakeMesh(ref Mesh m)
+ {
+ this.SampleAnim();
+ this.BakeMesh(ref m);
+ }
+
+ private void SampleAnim()
+ {
+ if (this.animation == null)
+ {
+ Debug.LogError("animation is null!!");
+ return;
+ }
+
+ this.animation.Sample();
+ }
+
+ private void BakeMesh(ref Mesh m)
+ {
+ if (this.skin == null)
+ {
+ Debug.LogError("skin is null!!");
+ return;
+ }
+
+ this.skin.BakeMesh(m);
+ }
+
+
+ #endregion
+
+}
+
+///
+/// 烘焙后的数据
+///
+public struct BakedData
+{
+ #region 字段
+
+ public string name;
+ public float animLen;
+ public byte[] rawAnimMap;
+ public int animMapWidth;
+ public int animMapHeight;
+
+ #endregion
+
+ public BakedData(string name, float animLen, Texture2D animMap)
+ {
+ this.name = name;
+ this.animLen = animLen;
+ this.animMapHeight = animMap.height;
+ this.animMapWidth = animMap.width;
+ this.rawAnimMap = animMap.GetRawTextureData();
+ }
+}
+
+///
+/// 烘焙器
+///
+public class AnimMapBaker{
+
+ #region 字段
+
+ private AnimData? animData = null;
+ private List vertices = new List();
+ private Mesh bakedMesh;
+
+ private List bakedDataList = new List();
+
+ #endregion
+
+ #region 方法
+
+ public void SetAnimData(GameObject go)
+ {
+ if(go == null)
+ {
+ Debug.LogError("go is null!!");
+ return;
+ }
+
+ Animation anim = go.GetComponent();
+ SkinnedMeshRenderer smr = go.GetComponentInChildren();
+
+ if(anim == null || smr == null)
+ {
+ Debug.LogError("anim or smr is null!!");
+ return;
+ }
+ this.bakedMesh = new Mesh();
+ this.animData = new AnimData(anim, smr, go.name);
+ }
+ int animNum;
+ public List Bake()
+ {
+ if(this.animData == null)
+ {
+ Debug.LogError("bake data is null!!");
+ return this.bakedDataList;
+ }
+ //每一个动作都生成一个动作图
+ for(int i = 0; i < this.animData.Value.animClips.Count; i++)
+ {
+ animNum = i;
+ if (!this.animData.Value.animClips[i].clip.legacy)
+ {
+
+ Debug.LogError(string.Format("{0} is not legacy!!", this.animData.Value.animClips[i].clip.name));
+ continue;
+ }
+
+ BakePerAnimClip(this.animData.Value.animClips[i]);
+ }
+
+ return this.bakedDataList;
+ }
+
+ private void BakePerAnimClip(AnimationState curAnim)
+ {
+ int curClipFrame = 0;
+ float sampleTime = 0;
+ float perFrameTime = 0;
+
+ curClipFrame = Mathf.ClosestPowerOfTwo((int)(curAnim.clip.frameRate * curAnim.length));
+ perFrameTime = curAnim.length / curClipFrame; ;
+
+ Texture2D animMap = new Texture2D(this.animData.Value.mapWidth, curClipFrame, TextureFormat.RGBAHalf, false);
+ animMap.name = string.Format("{0}_{1}.animMap", this.animData.Value.name, curAnim.name);
+ this.animData.Value.AnimationPlay(curAnim.name);
+
+ for (int i = 0; i < curClipFrame; i++)
+ {
+ //EditorUtility.DisplayCancelableProgressBar("转换进度", $"正在处理第 {i}/{curClipFrame} 步", (float)i / curClipFrame);
+ curAnim.time = sampleTime;
+
+ this.animData.Value.SampleAnimAndBakeMesh(ref this.bakedMesh);
+
+ for(int j = 0; j < this.bakedMesh.vertexCount; j++)
+ {
+ //EditorUtility.DisplayCancelableProgressBar("转换进度", $"正在处理第 {i}/{curClipFrame} 步 {j}/{bakedMesh.vertexCount}点", (float)i / curClipFrame);
+ Vector3 vertex = this.bakedMesh.vertices[j];
+ animMap.SetPixel(j, i, new Color(vertex.x, vertex.y, vertex.z));
+ }
+
+ sampleTime += perFrameTime;
+ }
+ //EditorUtility.ClearProgressBar();
+
+ animMap.Apply();
+ Debug.Log($"{animNum}/{animData.Value.animClips.Count-1}");
+ if (animNum== animData.Value.animClips.Count - 1)
+ {
+ Debug.Log("转换完成");
+ }
+
+ this.bakedDataList.Add(new BakedData(animMap.name, curAnim.clip.length, animMap));
+ }
+
+ #endregion
+
+
+ #region 属性
+
+
+ #endregion
+
+}
diff --git a/Assets/Framework/Tool/AnimMapBaker/Script/AnimMapBaker.cs.meta b/Assets/Framework/Tool/AnimMapBaker/Script/AnimMapBaker.cs.meta
new file mode 100644
index 000000000..3b7f1c99d
--- /dev/null
+++ b/Assets/Framework/Tool/AnimMapBaker/Script/AnimMapBaker.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e9893f638b60a9149a7acc8142615fce
+timeCreated: 1501134718
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Framework/Tool/UITool/SubUIManager.cs b/Assets/Framework/Tool/UITool/SubUIManager.cs
index 2952fea78..ce7814da9 100644
--- a/Assets/Framework/Tool/UITool/SubUIManager.cs
+++ b/Assets/Framework/Tool/UITool/SubUIManager.cs
@@ -9,7 +9,7 @@ using UnityEngine.ResourceManagement.AsyncOperations;
///
public class SubUIManager
{
- public UIBase subUIBaseParent;
+ public UIBase parentUIBase;
private readonly Transform parent;
private readonly Dictionary panels = new Dictionary();
private readonly Dictionary addressMap = new Dictionary();
@@ -17,9 +17,10 @@ public class SubUIManager
{
return panels.TryGetValue(type, out var panel) ? panel as T : null;
}
- public SubUIManager(Transform parent, UIPanelAddressConfig uIPanelAddressConfig)
+ public SubUIManager(Transform parent, UIPanelAddressConfig uIPanelAddressConfig,UIBase parentUIBase)
{
this.parent = parent;
+ this.parentUIBase = parentUIBase;
foreach (var entry in uIPanelAddressConfig.panels)
{
if (!addressMap.ContainsKey(entry.type))
@@ -37,7 +38,6 @@ public class SubUIManager
if (addressMap.ContainsKey(type)) {
UIBase uIBase = await LoadAndShowAsync(type, addressMap[type], args);
- subUIBaseParent = uIBase;
}
else
diff --git a/Assets/MyGame/Scripts/Characters/Monster/MonsterControl.cs b/Assets/MyGame/Scripts/Characters/Monster/MonsterControl.cs
new file mode 100644
index 000000000..f914a7c6f
--- /dev/null
+++ b/Assets/MyGame/Scripts/Characters/Monster/MonsterControl.cs
@@ -0,0 +1,95 @@
+using Spine;
+using Spine.Unity;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+public class MonsterControl : MonoBehaviour
+{
+ public MonsterDataBase monsterData = new MonsterDataBase(new MonsterHealthBase());
+ public SkeletonAnimation skeleton;
+ public bool isSpine = true;
+ public Dictionary dic_AnimKeyAnimName = new Dictionary();
+ public CharacterStateType currState;
+ //这里捕鱼的结构很简单可以穿模直接写移动
+ void Update()
+ {
+ OnUpdate(currState);
+ }
+ public void Start()
+ {
+ ChangeState(CharacterStateType.move);
+ }
+ public virtual void OnMoveEnter()
+ {
+ PlayAnim(CharacterAnimationType.move);
+ }
+ public virtual void OnMoveExit()
+ {
+
+ }
+ float moveTime = 0;
+ public virtual void OnMoveUpdata()
+ {
+ moveTime += Time.deltaTime;
+
+ //播放动画
+ skeleton.AnimationState.SetAnimation(0, dic_AnimKeyAnimName[CharacterAnimationType.move], true);
+ //transform.position = new Vector3();//等策划给路线
+ Vector2 v2 = monsterData.moveLine.GetBezierPoint(moveTime);
+ Debug.Log(v2);
+ transform.position = v2;
+ //transform.Translate(Vector3.down);
+
+ }
+
+ public void PlayAnim(CharacterAnimationType animType, bool loop = true)
+ {
+ skeleton.AnimationState.SetAnimation(0, dic_AnimKeyAnimName[animType], loop);
+ }
+ public void OnEnter(CharacterStateType stateType)
+ {
+ switch (stateType)
+ {
+ case CharacterStateType.move:
+ OnMoveEnter();
+ break;
+ case CharacterStateType.idle:
+ break;
+ default:
+ break;
+ }
+ }
+ public void OnUpdate(CharacterStateType stateType)
+ {
+ switch (stateType)
+ {
+ case CharacterStateType.move:
+ OnMoveUpdata();
+ break;
+ case CharacterStateType.idle:
+ break;
+ default:
+ break;
+ }
+ }
+ public void OnExit(CharacterStateType stateType)
+ {
+ switch (stateType)
+ {
+ case CharacterStateType.move:
+ break;
+ case CharacterStateType.idle:
+ break;
+ default:
+ break;
+ }
+ }
+ public void ChangeState(CharacterStateType stateType)
+ {
+ OnExit(currState);
+ currState = stateType;
+ OnEnter(currState);
+ }
+}
diff --git a/Assets/MyGame/Scripts/Characters/Monster/MonsterControl.cs.meta b/Assets/MyGame/Scripts/Characters/Monster/MonsterControl.cs.meta
new file mode 100644
index 000000000..0979e0443
--- /dev/null
+++ b/Assets/MyGame/Scripts/Characters/Monster/MonsterControl.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 88a585a55ecbd404fbb33a54beef9d83
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/MyGame/Scripts/Manager/GameManager.cs b/Assets/MyGame/Scripts/Manager/GameManager.cs
index 314c9d660..a1d03cdfa 100644
--- a/Assets/MyGame/Scripts/Manager/GameManager.cs
+++ b/Assets/MyGame/Scripts/Manager/GameManager.cs
@@ -12,6 +12,7 @@ public class GameManager : MonoSingleton
public Scene scene;
protected override async void Awake()
{
+ Application.runInBackground = true;
base.Awake();
gameData.currUser="123";
MonsterMoveLine.LoadBezier();//初始化加载路线
diff --git a/Assets/MyGame/Scripts/Manager/New Folder.meta b/Assets/MyGame/Scripts/Manager/New Folder.meta
new file mode 100644
index 000000000..fb33f14b6
--- /dev/null
+++ b/Assets/MyGame/Scripts/Manager/New Folder.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a7724d5a5ef361f4fa203c706d55ddfb
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/MyGame/Scripts/Net/WebResponses/ChineseChess/ChineseChessGameClassList.cs b/Assets/MyGame/Scripts/Net/WebResponses/ChineseChess/ChineseChessGameClassList.cs
index c3b409419..8dbfd1bc5 100644
--- a/Assets/MyGame/Scripts/Net/WebResponses/ChineseChess/ChineseChessGameClassList.cs
+++ b/Assets/MyGame/Scripts/Net/WebResponses/ChineseChess/ChineseChessGameClassList.cs
@@ -22,8 +22,6 @@ namespace Assets.MyGame.Scripts.Net.WebResponses.ChineseChess
/// 用户ID
///
public string userId { get; set; }
- ///
-
///
/// 游戏类型 1 我方黑 2 我方红
@@ -61,7 +59,7 @@ namespace Assets.MyGame.Scripts.Net.WebResponses.ChineseChess
public DateTime createTime { get; set; }
///
- /// 游戏类型 1 我方黑 2 我方红
+ /// 游戏类型 1 房主黑 2 房主红
///
public int gameType { get; set; }
diff --git a/Assets/MyGame/Scripts/Net/WebSocketManager_Message.cs b/Assets/MyGame/Scripts/Net/WebSocketManager_Message.cs
index c7dec30e4..478c70f8a 100644
--- a/Assets/MyGame/Scripts/Net/WebSocketManager_Message.cs
+++ b/Assets/MyGame/Scripts/Net/WebSocketManager_Message.cs
@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
+using static Assets.MyGame.Scripts.Net.WebResponses.ChineseChess.ChineseChessGameClassList;
namespace Assets.MyGame.Scripts.Net
{
@@ -39,14 +40,14 @@ namespace Assets.MyGame.Scripts.Net
break;
}
}
-
+
#endregion
}
private static void ChineseChess(string msg, WebSocketResponseBase