同步进度
This commit is contained in:
@@ -0,0 +1,184 @@
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using Assets.MyGame.Scripts.Net.APIResponses.Enum;
|
||||
using Spine;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static MonsterMoveLine;
|
||||
|
||||
public class MonsterContral : MonoBehaviour
|
||||
{
|
||||
public string hashCode;
|
||||
public MonsterDataBase monsterData = new MonsterDataBase(new MonsterHealthBase());
|
||||
public SkeletonAnimation skeleton;
|
||||
public bool isSpine = true;
|
||||
|
||||
public Dictionary<CharacterAnimationType, string> dic_AnimKeyAnimName = new Dictionary<CharacterAnimationType, string>();
|
||||
public CharacterStateType currState;
|
||||
public GameObject effect_Hurt;//遮罩闪烁
|
||||
public int HP = 5;
|
||||
public GameObject effect_Die;//删除
|
||||
GameObject hurt;
|
||||
public FishTypeEnum fishType=FishTypeEnum.普通鱼;
|
||||
//递归查找子物体
|
||||
Transform FindDeepChild(Transform parent, string name)
|
||||
{
|
||||
|
||||
foreach (Transform child in parent)
|
||||
{
|
||||
if (child.name == name)
|
||||
return child;
|
||||
var result = FindDeepChild(child, name);
|
||||
if (result != null)
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void Init(BezierCurveData bezierCurveData, float Time, bool isyuzhen = false)
|
||||
{
|
||||
monsterData.moveLine.Init(bezierCurveData, 10);
|
||||
isyz = isyuzhen;
|
||||
if (bezierCurveData.start.y>0)
|
||||
{
|
||||
transform.Rotate(Vector3.forward * 180);
|
||||
}
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
var t = FindDeepChild(transform,"HitEffect");
|
||||
if (t!=null)
|
||||
{
|
||||
hurt = t.gameObject;
|
||||
hurt.SetActive(false);
|
||||
}
|
||||
|
||||
}
|
||||
public void OnHurt()
|
||||
{
|
||||
if (hurt!=null)
|
||||
{
|
||||
StartCoroutine(Hurt());
|
||||
}
|
||||
}
|
||||
//受击闪烁
|
||||
IEnumerator Hurt()
|
||||
{
|
||||
hurt.SetActive(true);
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
hurt.SetActive(false);
|
||||
}
|
||||
public void InitAnimList()
|
||||
{
|
||||
dic_AnimKeyAnimName.Add(CharacterAnimationType.move, "stand2");
|
||||
}
|
||||
//这里捕鱼的结构很简单可以穿模直接写移动
|
||||
void Update()
|
||||
{
|
||||
OnUpdate(currState);
|
||||
}
|
||||
public void Start()
|
||||
{
|
||||
InitAnimList();
|
||||
ChangeState(CharacterStateType.move);
|
||||
}
|
||||
public virtual void OnMoveEnter()
|
||||
{
|
||||
PlayAnim(CharacterAnimationType.move);
|
||||
//播放动画
|
||||
//skeleton.AnimationState.SetAnimation(0, dic_AnimKeyAnimName[CharacterAnimationType.move], true);
|
||||
}
|
||||
public virtual void OnMoveExit()
|
||||
{
|
||||
|
||||
}
|
||||
float moveTime = 0;
|
||||
public bool isyz = false;
|
||||
public string yzID="";
|
||||
public virtual void OnMoveUpdata()
|
||||
{
|
||||
if (isyz)
|
||||
{
|
||||
switch (yzID)
|
||||
{
|
||||
case "30001":
|
||||
moveTime += Time.deltaTime;
|
||||
var movestart=monsterData.moveLine.bezierCurveData.start;
|
||||
Vector2 v2 = movestart+(Vector2)(transform.up*moveTime* monsterData.moveLine.moveTime);
|
||||
transform.position = v2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
moveTime += Time.deltaTime;
|
||||
Vector2 v2 = monsterData.moveLine.GetBezierPoint(moveTime);
|
||||
if (fishType != FishTypeEnum.Boss鱼)
|
||||
{
|
||||
transform.up = ((Vector2)transform.position - v2).normalized;
|
||||
}
|
||||
transform.position = v2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void PlayAnim(CharacterAnimationType animType, bool loop = true)
|
||||
{
|
||||
if (skeleton!=null)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88a585a55ecbd404fbb33a54beef9d83
|
||||
guid: 5e5dca86a57fe2144a34f1f2ddb93962
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,105 +0,0 @@
|
||||
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<CharacterAnimationType, string> dic_AnimKeyAnimName = new Dictionary<CharacterAnimationType, string>();
|
||||
public CharacterStateType currState;
|
||||
public GameObject effect_Hurt;//遮罩闪烁
|
||||
|
||||
public GameObject effect_Die;//删除
|
||||
|
||||
|
||||
public void InitAnimList()
|
||||
{
|
||||
dic_AnimKeyAnimName.Add(CharacterAnimationType.move, "stand2");
|
||||
}
|
||||
//这里捕鱼的结构很简单可以穿模直接写移动
|
||||
void Update()
|
||||
{
|
||||
OnUpdate(currState);
|
||||
}
|
||||
public void Start()
|
||||
{
|
||||
InitAnimList();
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
[System.Serializable]
|
||||
@@ -6,6 +7,7 @@ public class MonsterDataBase : CharactersDataBase
|
||||
{
|
||||
public float die_Score;
|
||||
public bool isDie;
|
||||
public RoomFishDetailConfig roomFishDetailConfig;
|
||||
|
||||
public MonsterMoveLine moveLine=new MonsterMoveLine();
|
||||
public MonsterDataBase(MonsterHealthBase health) : base(health)
|
||||
|
||||
@@ -18,19 +18,21 @@ public class MonsterMoveLine
|
||||
public Vector2 end;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static async void LoadBezier()
|
||||
{
|
||||
await LoadBezierTxtAsync("MoveLine");
|
||||
}
|
||||
/// <summary>
|
||||
/// 读取数据 游戏开始时在awake调用aa包
|
||||
/// 读取曲线数据 读取单个
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task LoadBezierTxtAsync(string path)
|
||||
public static async Task LoadSingleBezierTxtAsync(string path)
|
||||
{
|
||||
AsyncOperationHandle<TextAsset> handle = Addressables.LoadAssetAsync<TextAsset>(path);
|
||||
await handle.Task;
|
||||
var lines = handle.Result.text.Split('\n');
|
||||
|
||||
|
||||
|
||||
foreach (var line in lines)
|
||||
{
|
||||
@@ -51,9 +53,12 @@ public class MonsterMoveLine
|
||||
|
||||
// 第一个点是 start
|
||||
curve.start = points[0];
|
||||
if (points.Count > 1)
|
||||
{
|
||||
// 最后一个点是 end
|
||||
curve.end = points[points.Count - 1];
|
||||
}
|
||||
|
||||
// 最后一个点是 end
|
||||
curve.end = points[points.Count - 1];
|
||||
|
||||
// 中间的都是 controlPoints
|
||||
for (int i = 1; i < points.Count - 1; i++)
|
||||
@@ -62,10 +67,64 @@ public class MonsterMoveLine
|
||||
}
|
||||
|
||||
curves.Add(curve);
|
||||
dic_BezierCurveDatas.Add(curve.name,curve);
|
||||
}
|
||||
dic_BezierCurveDatas.Add(curve.name, curve);
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 读取曲线数据 游戏开始时在awake调用aa包
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task LoadBezierTxtAsync(string path)
|
||||
{
|
||||
AsyncOperationHandle<IList<TextAsset>> handles = Addressables.LoadAssetsAsync<TextAsset>(path,null);
|
||||
await handles.Task;
|
||||
foreach (var text in handles.Result)
|
||||
{
|
||||
var lines = text.text.Split('\n');
|
||||
|
||||
|
||||
foreach (var line in lines)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(line)) continue;
|
||||
|
||||
var parts = line.Split(';');
|
||||
BezierCurveData curve = new BezierCurveData();
|
||||
|
||||
// 第一个是曲线名
|
||||
curve.name = parts[0];
|
||||
|
||||
// 后面所有都是点
|
||||
List<Vector2> points = new List<Vector2>();
|
||||
for (int i = 1; i < parts.Length; i++)
|
||||
{
|
||||
points.Add(ParseVector(parts[i]));
|
||||
}
|
||||
|
||||
// 第一个点是 start
|
||||
curve.start = points[0];
|
||||
if (points.Count > 1)
|
||||
{
|
||||
// 最后一个点是 end
|
||||
curve.end = points[points.Count - 1];
|
||||
}
|
||||
|
||||
|
||||
// 中间的都是 controlPoints
|
||||
for (int i = 1; i < points.Count - 1; i++)
|
||||
{
|
||||
curve.controlPoints.Add(points[i]);
|
||||
}
|
||||
|
||||
curves.Add(curve);
|
||||
dic_BezierCurveDatas.Add(curve.name, curve);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("曲线读取完成共" + dic_BezierCurveDatas.Count + "条");
|
||||
|
||||
}
|
||||
|
||||
private static Vector2 ParseVector(string s)
|
||||
@@ -83,7 +142,13 @@ public class MonsterMoveLine
|
||||
{
|
||||
this.bezierCurveData = bezierCurveData;
|
||||
this.moveTime = Time;
|
||||
Debug.Log($"初始化曲线 {this.bezierCurveData.name} ,移动时间 {moveTime}");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取曲线上的点
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
public Vector2 GetBezierPoint(float t)
|
||||
{
|
||||
t = t / moveTime;
|
||||
@@ -95,6 +160,7 @@ public class MonsterMoveLine
|
||||
|
||||
return DeCasteljau(points, t%1);
|
||||
}
|
||||
|
||||
|
||||
private Vector2 DeCasteljau(List<Vector2> points, float t)
|
||||
{
|
||||
@@ -107,50 +173,9 @@ public class MonsterMoveLine
|
||||
}
|
||||
points = next;
|
||||
}
|
||||
return CanvasToWorld( points[0],UIManager.Instance.uiRoot.GetComponent<RectTransform>(),Camera.main);
|
||||
}
|
||||
public static Vector3 CanvasToWorld(Vector2 canvasPos, RectTransform canvas, Camera cam)
|
||||
{
|
||||
// 1. 获取 Canvas 实际像素尺寸(自动适配所有设备)
|
||||
float canvasWidth = canvas.rect.width;
|
||||
float canvasHeight = canvas.rect.height;
|
||||
|
||||
// 2. 正交相机的世界高度
|
||||
float worldHeight = cam.orthographicSize * 2f;
|
||||
|
||||
// 3. 世界宽度 = 世界高度 * 屏幕宽高比
|
||||
float worldWidth = worldHeight * cam.aspect;
|
||||
|
||||
// 4. 画布单位 → 世界单位比例(横竖一致)
|
||||
float scaleX = worldWidth / canvasWidth;
|
||||
float scaleY = worldHeight / canvasHeight;
|
||||
|
||||
// 5. 你的 canvasPos 是以中心为原点的坐标
|
||||
float worldX = canvasPos.x * scaleX;
|
||||
float worldY = canvasPos.y * scaleY;
|
||||
|
||||
// 6. 映射到世界 z = 0 平面
|
||||
return new Vector3(worldX, worldY, 0f);
|
||||
return CoordinateTransformation.CanvasToWorld( points[0],UIManager.Instance.uiRoot.GetComponent<RectTransform>(),Camera.main);
|
||||
}
|
||||
|
||||
public static Vector2 AnchoredPos_ToCanvas(RectTransform target, Canvas canvas)
|
||||
{
|
||||
// 1. 先把 anchoredPosition(父坐标)转换成世界坐标
|
||||
Vector3 worldPos = target.TransformPoint(target.anchoredPosition);
|
||||
|
||||
// 2. 再把世界坐标转换成 Canvas 的局部坐标(等价于 Canvas 下的 anchoredPosition)
|
||||
RectTransform canvasRT = canvas.GetComponent<RectTransform>();
|
||||
|
||||
Vector2 canvasLocalPos;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(
|
||||
canvasRT,
|
||||
RectTransformUtility.WorldToScreenPoint(canvas.worldCamera, worldPos),
|
||||
canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera,
|
||||
out canvasLocalPos
|
||||
);
|
||||
|
||||
return canvasLocalPos;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using Model.Entity.BaseModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public enum FishCreateType
|
||||
{
|
||||
None,
|
||||
Line,
|
||||
}
|
||||
public static class CreateFishType
|
||||
{
|
||||
public static Dictionary<FishCreateType, Action<RoomFishDetailConfig>> dic_CreateFishType = new Dictionary<FishCreateType, Action<RoomFishDetailConfig>>();
|
||||
static CreateFishType()
|
||||
{
|
||||
//dic_CreateFishType.Add(FishCreateType.Line, CreateLine);
|
||||
}
|
||||
public static void CreateFish(RoomFishDetailConfig roomFishDetailConfig)
|
||||
{
|
||||
switch (roomFishDetailConfig.Type)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd4d4aaffcca6c742943da902e2e5d4e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,21 +1,48 @@
|
||||
using System.Collections;
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
public class BullitMove : MonoBehaviour
|
||||
{
|
||||
public RoomJoinNotice user;
|
||||
public float moveSpeed = 5;
|
||||
public float desTime = 10f;
|
||||
public string playerID;
|
||||
public GameObject effectPrefab;
|
||||
public GameObject diePrefab;
|
||||
float currShowTime = 0f;
|
||||
Vector3 vector3_startPosition;
|
||||
public bool isTriggerFirst=true;
|
||||
public bool isTriggerFirst = true;
|
||||
MonsterContral target;
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
Init();
|
||||
Destroy(gameObject, desTime);
|
||||
//Destroy(gameObject, desTime);
|
||||
}
|
||||
bool isLock = false;
|
||||
public void Lock(MonsterContral monsterContral)
|
||||
{
|
||||
foreach (var item in GetComponents<Collider2D>())
|
||||
{
|
||||
item.enabled = false;
|
||||
}
|
||||
isLock = true;
|
||||
target = monsterContral;
|
||||
}
|
||||
public void NotLock()
|
||||
{
|
||||
foreach (var item in GetComponents<Collider2D>())
|
||||
{
|
||||
item.enabled = true;
|
||||
}
|
||||
isLock = false;
|
||||
target = null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 对象池用
|
||||
@@ -24,33 +51,145 @@ public class BullitMove : MonoBehaviour
|
||||
{
|
||||
vector3_startPosition = transform.position;
|
||||
}
|
||||
//子弹同步分为两种一种是锁定目标一种是不锁定目标
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//方便帧同步
|
||||
currShowTime += Time.deltaTime;
|
||||
Vector3 targetPoint = transform.up.normalized * currShowTime * moveSpeed;
|
||||
transform.position = vector3_startPosition + targetPoint;
|
||||
if (isLock)
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
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.Slerp(transform.up, targetPoint, rotateSpeed);
|
||||
targetPoint = transform.up.normalized * moveSpeed * Time.deltaTime;
|
||||
transform.position+= targetPoint;
|
||||
if (ABdistance <= 2)
|
||||
{
|
||||
AttackFish(target);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//方便帧同步
|
||||
currShowTime += Time.deltaTime;
|
||||
Vector3 targetPoint = transform.up.normalized * currShowTime * moveSpeed;
|
||||
transform.position = vector3_startPosition + targetPoint;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void OnTriggerEnter2D(Collider2D collision)
|
||||
private void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
if (isTriggerFirst)
|
||||
{
|
||||
if (collision.tag == "Monster")
|
||||
if (collision.transform.tag == "Fish")
|
||||
{
|
||||
isTriggerFirst=false;
|
||||
isTriggerFirst = false;
|
||||
//击中特效
|
||||
Instantiate(effectPrefab,transform.position,Quaternion.identity);
|
||||
if (effectPrefab != null)
|
||||
{
|
||||
Instantiate(effectPrefab, transform.position, Quaternion.identity, transform.parent);
|
||||
}
|
||||
|
||||
//受激
|
||||
collision.transform.GetComponent<MonsterControl>().monsterData.charactersHealth.OnHurt(10, CharacterHurtType.none);
|
||||
Destroy(collision.gameObject);
|
||||
var monster = collision.transform.GetComponentInParent<MonsterContral>();
|
||||
monster.monsterData.charactersHealth.OnHurt(10, CharacterHurtType.none);
|
||||
Destroy(monster.gameObject);
|
||||
Destroy(gameObject);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public static Quaternion RotationFromVector2(Vector2 dir)
|
||||
{
|
||||
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
|
||||
return Quaternion.Euler(0, 0, angle);
|
||||
}
|
||||
// 计算反射角度
|
||||
Vector2 GetReflectionAngle(Vector2 velocity, Vector2 normal)
|
||||
{
|
||||
// 反射向量
|
||||
return Vector2.Reflect(velocity.normalized, normal.normalized);
|
||||
|
||||
}
|
||||
public void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
if (isTriggerFirst)
|
||||
{
|
||||
if (collision.tag == "Fish")
|
||||
{
|
||||
isTriggerFirst = false;
|
||||
var monster = collision.transform.GetComponentInParent<MonsterContral>();
|
||||
|
||||
AttackFish(monster);
|
||||
|
||||
}
|
||||
else if (collision.tag == "Wall")
|
||||
{
|
||||
Vector3 v3 = transform.eulerAngles;
|
||||
switch (collision.name)
|
||||
{
|
||||
case "up":
|
||||
v3.z = -v3.z+180;
|
||||
break;
|
||||
case "down":
|
||||
v3.z = -v3.z + 180;
|
||||
break;
|
||||
case "left":
|
||||
v3.z = -v3.z;
|
||||
break;
|
||||
case "right":
|
||||
v3.z = -v3.z;
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
vector3_startPosition = transform.position;
|
||||
currShowTime = 0;
|
||||
transform.eulerAngles = v3;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void AttackFish(MonsterContral monster)
|
||||
{
|
||||
//击中特效
|
||||
if (effectPrefab != null)
|
||||
{
|
||||
Instantiate(effectPrefab, transform.position, Quaternion.identity, transform.parent);
|
||||
}
|
||||
|
||||
//请求服务端是否杀死
|
||||
var v1 = GameManager.Instance.gameData.roomJoinNotice;
|
||||
var v2 = GameManager.Instance.gameData.currRoomData;
|
||||
WebSocketSendList.KillFish(v2.roomId, user.userId, monster.monsterData.roomFishDetailConfig.fishNumber, monster.hashCode,GameManager.Instance.gameData.roomJoinNotice.cannonMultiple);
|
||||
|
||||
|
||||
//受激
|
||||
|
||||
//monster.monsterData.charactersHealth.OnHurt(10, CharacterHurtType.none);
|
||||
//monster.HP--;
|
||||
//if (monster.HP == 0)
|
||||
//{
|
||||
// Instantiate(monster.effect_Die == null ? diePrefab : monster.effect_Die, monster.transform.position, Quaternion.identity, transform.parent);
|
||||
// Destroy(monster.gameObject);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
monster.OnHurt();
|
||||
//}
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using Model.Entity;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "createassetMenu", menuName = "fishCreate", order = 0)]
|
||||
public class CreateFishData : ScriptableObject
|
||||
{
|
||||
public GameConfig gameConfig;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 448dd789737bdee49806647168069597
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,405 @@
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using Assets.MyGame.Scripts.Net.APIResponses.Enum;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using Unity.Collections;
|
||||
using Unity.Jobs;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
{
|
||||
#region //这里不用了 但是留着
|
||||
/*public CreateFishData createFishData;
|
||||
public async void InitCreateFishData(string path)
|
||||
{
|
||||
createFishData = await Addressables.LoadAssetAsync<CreateFishData>(path).Task;
|
||||
}
|
||||
public string path;*/
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 全局配置(外部初始化)
|
||||
/// </summary>
|
||||
//public GameConfig M_GameConfig { get { return GameManager.Instance.gameConfig; } }
|
||||
#endregion
|
||||
public GameConfig M_GameConfig => GameManager.Instance.gameConfig;
|
||||
|
||||
// 缓存字段
|
||||
private Dictionary<GameTypeEnum, RoomFishConfig> roomFishConfig;
|
||||
private Dictionary<GameTypeEnum, Dictionary<string, RoomFishDetailConfig>> createDic;
|
||||
private Dictionary<string, FishTypeConfig> fishDatas;
|
||||
public Dictionary<string,MonsterContral> fishDatas_hashCodekey=new Dictionary<string, MonsterContral>();
|
||||
public Dictionary<string, FishTypeConfig> FishDatas { get {
|
||||
if (fishDatas != null)
|
||||
return fishDatas;
|
||||
fishDatas =new Dictionary<string, FishTypeConfig>();
|
||||
foreach (var item in M_GameConfig.fishTypeConfigs)
|
||||
{
|
||||
fishDatas.Add(item.fishNumber, item);
|
||||
}
|
||||
return fishDatas;
|
||||
} }
|
||||
#region 初始化鱼生成配置
|
||||
/// <summary>
|
||||
/// 懒加载初始化(只执行一次)
|
||||
/// </summary>
|
||||
private void EnsureInit()
|
||||
{
|
||||
if (roomFishConfig != null)
|
||||
return;
|
||||
|
||||
roomFishConfig = new Dictionary<GameTypeEnum, RoomFishConfig>();
|
||||
createDic = new Dictionary<GameTypeEnum, Dictionary<string, RoomFishDetailConfig>>();
|
||||
|
||||
|
||||
var list = GameManager.Instance.gameConfig.roomFishConfigs;
|
||||
if (list == null || list.Count == 0)
|
||||
return;
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
GameTypeEnum gameType = (GameTypeEnum)item.gameType;
|
||||
|
||||
// 安全添加(避免重复 key 抛异常)
|
||||
roomFishConfig[gameType] = item;
|
||||
|
||||
// 初始化子字典
|
||||
var fishDic = new Dictionary<string, RoomFishDetailConfig>();
|
||||
createDic[gameType] = fishDic;
|
||||
|
||||
// 普通鱼
|
||||
if (item.normalFishList != null)
|
||||
{
|
||||
foreach (var fish in item.normalFishList)
|
||||
fishDic[fish.fishNumber] = fish;
|
||||
}
|
||||
|
||||
// 等级鱼(若与基础鱼相同素材替换基础的)
|
||||
if (item.roomFishLevelList != null)
|
||||
{
|
||||
foreach (var fish in item.roomFishLevelList)
|
||||
fishDic[fish.fishNumber] = fish;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 房间鱼配置(按游戏类型)
|
||||
/// </summary>
|
||||
public Dictionary<GameTypeEnum, RoomFishConfig> RoomFishConfig
|
||||
{
|
||||
get
|
||||
{
|
||||
EnsureInit();
|
||||
return roomFishConfig;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鱼号 → 鱼配置(按游戏类型)
|
||||
/// </summary>
|
||||
public Dictionary<GameTypeEnum, Dictionary<string, RoomFishDetailConfig>> CreateDic
|
||||
{
|
||||
get
|
||||
{
|
||||
EnsureInit();
|
||||
return createDic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region // 鱼生成计时器相关
|
||||
private NativeArray<float> timers;
|
||||
private NativeArray<float> frequencies;
|
||||
private NativeArray<int> shouldSpawn;
|
||||
public GameObject dieFXPrefab;
|
||||
private List<RoomFishDetailConfig> spawnList; // 当前房间的鱼配置
|
||||
public void InitSpawnSystem(GameTypeEnum gameType)
|
||||
{
|
||||
EnsureInit();
|
||||
|
||||
var config = RoomFishConfig[gameType];
|
||||
spawnList = new List<RoomFishDetailConfig>();
|
||||
|
||||
// 合并普通鱼 + 等级鱼
|
||||
spawnList.AddRange(config.normalFishList);
|
||||
spawnList.AddRange(config.roomFishLevelList);
|
||||
|
||||
int count = spawnList.Count;
|
||||
|
||||
timers = new NativeArray<float>(count, Allocator.Persistent);
|
||||
frequencies = new NativeArray<float>(count, Allocator.Persistent);
|
||||
shouldSpawn = new NativeArray<int>(count, Allocator.Persistent);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
timers[i] = 0;
|
||||
frequencies[i] = spawnList[i].fishFrequency;
|
||||
shouldSpawn[i] = 0;
|
||||
}
|
||||
}
|
||||
public void CloseSpawnSystem()
|
||||
{
|
||||
spawnList = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 鱼的父节点(用于层级管理)
|
||||
/// </summary>
|
||||
public Transform fishRoot;
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
if (fishRoot == null)
|
||||
{
|
||||
fishRoot = new GameObject("FishRoot").transform;
|
||||
}
|
||||
// CreateSingleFish();
|
||||
new FishResourcesData(); //这里用来测试加载鱼预制体
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (spawnList == null)
|
||||
return;
|
||||
|
||||
var job = new FishSpawnTimerJob
|
||||
{
|
||||
deltaTime = Time.deltaTime,
|
||||
timers = timers,
|
||||
frequencies = frequencies,
|
||||
shouldSpawn = shouldSpawn
|
||||
};
|
||||
|
||||
JobHandle handle = job.Schedule();
|
||||
handle.Complete();
|
||||
|
||||
// 主线程执行生成
|
||||
for (int i = 0; i < spawnList.Count; i++)
|
||||
{
|
||||
if (shouldSpawn[i] == 1)
|
||||
{
|
||||
var fish = spawnList[i];
|
||||
SpawnFishMainThread(fish);
|
||||
}
|
||||
}
|
||||
}
|
||||
private async void SpawnFishMainThread(RoomFishDetailConfig cfg)
|
||||
{
|
||||
|
||||
if (cfg.type==1)
|
||||
{
|
||||
bool flowControl = OnlyFish(cfg);
|
||||
if (!flowControl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (cfg.type==2)
|
||||
{
|
||||
//cfg.fishNumber;3
|
||||
var yz = GameManager.Instance.gameConfig.fishArrayConfigs.Find(a => a.arrayNumber == cfg.fishNumber);
|
||||
|
||||
FishTypeConfig fishType = M_GameConfig.fishTypeConfigs
|
||||
.Find(f => f.fishNumber == yz.fishNumber);
|
||||
// 3. 出生点
|
||||
Vector3 pos = new Vector3(
|
||||
9999, 9999, 0
|
||||
);
|
||||
var prefab = FishResourcesData.GetFishPrefab(fishType.fishNumber);
|
||||
|
||||
|
||||
switch (cfg.fishNumber)
|
||||
{
|
||||
case "30001":
|
||||
for (int i = 0; i < yz.fishCount; i++)
|
||||
{
|
||||
|
||||
// 4. 实例化
|
||||
GameObject fish = Instantiate(prefab, pos, Quaternion.Euler(Vector3.forward* (yz.fishCount *10/2)+ Vector3.forward*i*10), fishRoot);
|
||||
var v = fish.GetComponent<MonsterContral>();
|
||||
v.monsterData.roomFishDetailConfig = cfg;
|
||||
v.hashCode = v.gameObject.GetHashCode().ToString();
|
||||
fishDatas_hashCodekey[v.hashCode] = v;
|
||||
var list = FishDatas[cfg.fishNumber].pathList;
|
||||
//int pathId = list[Random.Range(0, list.Count)];
|
||||
int pathId = list[Random.Range(0, 5)];
|
||||
v.Init(MonsterMoveLine.dic_BezierCurveDatas["鱼阵" + pathId+1], 10,true);
|
||||
v.fishType = (FishTypeEnum)FishDatas[cfg.fishNumber].fishType;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//// 4. 实例化
|
||||
//GameObject fish = Instantiate(prefab, pos, Quaternion.identity, fishRoot);
|
||||
//var v = fish.GetComponent<MonsterContral>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool OnlyFish(RoomFishDetailConfig cfg)
|
||||
{
|
||||
// 1. 找到鱼的基础配置
|
||||
FishTypeConfig fishType = M_GameConfig.fishTypeConfigs
|
||||
.Find(f => f.fishNumber == cfg.fishNumber);
|
||||
|
||||
if (fishType == null)
|
||||
{
|
||||
Debug.LogError($"找不到鱼配置:{cfg.fishNumber}");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. 加载 Prefab(imageUrl 你可以换成自己的字段)
|
||||
//var prefab = await Addressables.LoadAssetAsync<GameObject>(fishType.imageUrl).Task;
|
||||
var prefab = FishResourcesData.GetFishPrefab(fishType.fishNumber);
|
||||
|
||||
// 3. 出生点
|
||||
Vector3 pos = new Vector3(
|
||||
9999, 9999, 0
|
||||
);
|
||||
|
||||
// 4. 实例化
|
||||
GameObject fish = Instantiate(prefab, pos, Quaternion.identity, fishRoot);
|
||||
var v = fish.GetComponent<MonsterContral>();
|
||||
// 5. 初始化路径
|
||||
if (v == null)
|
||||
{
|
||||
v = fish.AddComponent<MonsterContral>();
|
||||
}
|
||||
v.monsterData.roomFishDetailConfig = cfg;
|
||||
v.hashCode = v.gameObject.GetHashCode().ToString();
|
||||
fishDatas_hashCodekey[v.hashCode] = v;
|
||||
var list = FishDatas[cfg.fishNumber].pathList;
|
||||
int pathId = list[Random.Range(0, list.Count)];
|
||||
v.monsterData.moveLine.Init(MonsterMoveLine.dic_BezierCurveDatas["曲线" + pathId], 10);
|
||||
v.fishType = (FishTypeEnum)FishDatas[cfg.fishNumber].fishType;
|
||||
//v.monsterData.moveLine.Init(MonsterMoveLine.dic_BezierCurveDatas["曲线" + Random.Range(1, 4).ToString()], 10);
|
||||
////初始化
|
||||
//GameObject obj = Instantiate(prefab, Vector3.one * 999, Quaternion.identity);
|
||||
//var v = obj.GetComponent<MonsterControl>();
|
||||
////v.dic_AnimKeyAnimName.Add(CharacterAnimationType.move, "stand2");
|
||||
|
||||
//v.monsterData.moveLine.Init(MonsterMoveLine.dic_BezierCurveDatas["曲线" + Random.Range(1, 4).ToString()], 10);
|
||||
Debug.Log($"生成鱼:{fishType.fishName}");
|
||||
return true;
|
||||
}
|
||||
|
||||
public void CreateFishArray(string arrayNumber)
|
||||
{
|
||||
var array = M_GameConfig.fishArrayConfigs
|
||||
.Find(a => a.fishArrayNumber == arrayNumber);
|
||||
|
||||
if (array == null)
|
||||
{
|
||||
Debug.LogError($"找不到鱼阵:{arrayNumber}");
|
||||
return;
|
||||
}
|
||||
|
||||
// 未来扩展:阵型、路径、Boss、普通鱼
|
||||
//// array.ty.fishNumber
|
||||
|
||||
|
||||
|
||||
// // 2. 加载 Prefab(imageUrl 你可以换成自己的字段)
|
||||
// //var prefab = await Addressables.LoadAssetAsync<GameObject>(fishType.imageUrl).Task;
|
||||
// var prefab = FishResourcesData.CreateFishPrefab(fishType.fishNumber);
|
||||
|
||||
// // 3. 随机出生点
|
||||
// Vector3 pos = new Vector3(
|
||||
// Random.Range(-8f, 8f),
|
||||
// Random.Range(-5f, 5f),
|
||||
// 0
|
||||
// );
|
||||
|
||||
// // 4. 实例化
|
||||
// GameObject fish = Instantiate(prefab, pos, Quaternion.identity, fishRoot);
|
||||
// var v = fish.GetComponent<MonsterContral>();
|
||||
// // 5. 初始化路径
|
||||
// if (v == null)
|
||||
// {
|
||||
// v = fish.AddComponent<MonsterContral>();
|
||||
// }
|
||||
// v.monsterData.roomFishDetailConfig = cfg;
|
||||
// v.hashCode = v.gameObject.GetHashCode().ToString();
|
||||
// fishDatas_hashCodekey[v.hashCode] = v;
|
||||
// var list = FishDatas[cfg.fishNumber].pathList;
|
||||
// int pathId = list[Random.Range(0, list.Count)];
|
||||
// v.monsterData.moveLine.Init(MonsterMoveLine.dic_BezierCurveDatas["曲线" + pathId], 10);
|
||||
// v.fishType = (FishTypeEnum)FishDatas[cfg.fishNumber].fishType;
|
||||
// //v.monsterData.moveLine.Init(MonsterMoveLine.dic_BezierCurveDatas["曲线" + Random.Range(1, 4).ToString()], 10);
|
||||
// ////初始化
|
||||
// //GameObject obj = Instantiate(prefab, Vector3.one * 999, Quaternion.identity);
|
||||
// //var v = obj.GetComponent<MonsterControl>();
|
||||
// ////v.dic_AnimKeyAnimName.Add(CharacterAnimationType.move, "stand2");
|
||||
|
||||
// //v.monsterData.moveLine.Init(MonsterMoveLine.dic_BezierCurveDatas["曲线" + Random.Range(1, 4).ToString()], 10);
|
||||
// Debug.Log($"生成鱼:{fishType.fishName}");
|
||||
|
||||
|
||||
|
||||
}
|
||||
public void EnterRoom(GameTypeEnum gameType)
|
||||
{
|
||||
InitSpawnSystem(gameType);
|
||||
}
|
||||
public void ExitRoom()
|
||||
{
|
||||
CloseSpawnSystem();
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// 1. 生成单条鱼
|
||||
// ============================================================
|
||||
public async void CreateSingleFish(string fishNumber, int pathId)
|
||||
{
|
||||
switch ((GameTypeEnum)GameManager.Instance.gameData.currGameType)
|
||||
{
|
||||
case GameTypeEnum.风雷之渊:
|
||||
|
||||
break;
|
||||
case GameTypeEnum.太古仙墟:
|
||||
break;
|
||||
case GameTypeEnum.中国象棋:
|
||||
break;
|
||||
case GameTypeEnum.星际迷航:
|
||||
break;
|
||||
case GameTypeEnum.黑神话悟空:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void DesFish(string msg)
|
||||
{
|
||||
var killFish = JsonConvert.DeserializeObject<WebSocketResponseBase<RoomKillNotice>>(msg).arguments[0];
|
||||
if (fishDatas_hashCodekey.ContainsKey(killFish.fishId))
|
||||
{
|
||||
var monster = fishDatas_hashCodekey[killFish.fishId];
|
||||
Instantiate(monster.effect_Die == null ? dieFXPrefab : monster.effect_Die, monster.transform.position, Quaternion.identity, transform.parent);
|
||||
Destroy(monster.gameObject);
|
||||
fishDatas_hashCodekey.Remove(killFish.fishId);
|
||||
|
||||
GameManager.Instance.gameData.roomJoinNotice.gold += killFish.gold;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5aef59b4f4e8284bba9598af929a2fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using Unity.Jobs;
|
||||
using Unity.Burst;
|
||||
using Unity.Collections;
|
||||
|
||||
[BurstCompile]
|
||||
public struct FishSpawnTimerJob : IJob
|
||||
{
|
||||
public float deltaTime;
|
||||
public NativeArray<float> timers; // 每条鱼的计时器
|
||||
public NativeArray<float> frequencies; // 每条鱼的频率
|
||||
public NativeArray<int> shouldSpawn; // 输出:是否应该生成
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
for (int i = 0; i < timers.Length; i++)
|
||||
{
|
||||
timers[i] += deltaTime;
|
||||
|
||||
if (timers[i] >= frequencies[i])
|
||||
{
|
||||
timers[i] = 0;
|
||||
shouldSpawn[i] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
shouldSpawn[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f77586f15b6c4e48aa6dacb0a25eebb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,10 +1,14 @@
|
||||
using System.Collections;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameData
|
||||
{
|
||||
public GameType currGameType;
|
||||
public RoomJoinNotice roomJoinNotice;
|
||||
public RoomChangeResponse currRoomData;
|
||||
|
||||
public string currUser;
|
||||
public string a;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.API;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class GameManager : MonoSingleton<GameManager>
|
||||
{
|
||||
|
||||
public GameConfig gameConfig;
|
||||
public UserToken user;
|
||||
public GameData gameData=new GameData();
|
||||
public Scene scene;
|
||||
protected override async void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
gameData.currUser="123";
|
||||
//CharacterAnimationType
|
||||
MonsterMoveLine.LoadBezierTxtAsync("MoveLines");
|
||||
}
|
||||
MonsterMoveLine.LoadBezier();//初始化加载路线
|
||||
//string json = Resources.Load<TextAsset>("Config/GameConfig").text;
|
||||
|
||||
//gameConfig = JsonConvert.DeserializeObject<APIResponse<GameConfig>>(json).data;
|
||||
APIManager.Response<GameConfig>(APIType.GameConfig_Get, res => { gameConfig = res; var v = CreateFishManager.Instance.CreateDic; });
|
||||
|
||||
}
|
||||
public void StartGame()
|
||||
{
|
||||
|
||||
switch (gameData.currGameType)
|
||||
{
|
||||
case GameType.JQQD:
|
||||
@@ -34,7 +41,8 @@ public class GameManager : MonoSingleton<GameManager>
|
||||
UIManager.Instance.ShowAsync(UIPanel.MainGamePanelDefault);
|
||||
break;
|
||||
case GameType.XJMH:
|
||||
UIManager.Instance.ShowAsync(UIPanel.MainGamePanelXJMH);
|
||||
WebSocketManager.Instance.Connect(SocketType.game);
|
||||
|
||||
break;
|
||||
case GameType.HHWK:
|
||||
UIManager.Instance.ShowAsync(UIPanel.MainGamePanelDefault);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7724d5a5ef361f4fa203c706d55ddfb
|
||||
guid: 3813b58222a7b8242ae9705ab135bab6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,258 @@
|
||||
using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net
|
||||
{
|
||||
public static class APIManager
|
||||
{
|
||||
public static Dictionary<APIType, string> dic_API = new Dictionary<APIType, string>();
|
||||
public const string baseURL = "http://524game.32.hzgqapp.com";
|
||||
static string token;
|
||||
|
||||
static APIManager()
|
||||
{
|
||||
// ---------------- GameConfig ----------------
|
||||
dic_API[APIType.GameConfig_Init] = "/api/GameConfig/init";
|
||||
dic_API[APIType.GameConfig_Get] = "/api/GameConfig";
|
||||
dic_API[APIType.GameConfig_Update] = "/api/GameConfig/Update";
|
||||
|
||||
// ---------------- Hall ----------------
|
||||
dic_API[APIType.Hall_SaveSafeBox] = "/api/Hall/SaveSafeBox";
|
||||
dic_API[APIType.Hall_GetSafeBox] = "/api/Hall/GetSafeBox";
|
||||
dic_API[APIType.Hall_SetSafeBoxPassword] = "/api/Hall/SetSafeBoxPassword";
|
||||
dic_API[APIType.Hall_ResetSafeBoxPassword] = "/api/Hall/ResetSafeBoxPassword";
|
||||
dic_API[APIType.Hall_GetRelief] = "/api/Hall/GetRelief";
|
||||
dic_API[APIType.Hall_SynthesisFragment] = "/api/Hall/SynthesisFragment";
|
||||
dic_API[APIType.Hall_BuyMonthCard] = "/api/Hall/BuyMonthCard";
|
||||
dic_API[APIType.Hall_BuyProp] = "/api/Hall/BuyProp";
|
||||
dic_API[APIType.Hall_BuyGold] = "/api/Hall/BuyGold";
|
||||
dic_API[APIType.Hall_BuyDiamond] = "/api/Hall/BuyDiamond";
|
||||
dic_API[APIType.Hall_SignIn] = "/api/Hall/SignIn";
|
||||
dic_API[APIType.Hall_ChangeCannon] = "/api/Hall/ChangeCannon";
|
||||
dic_API[APIType.Hall_ChangeWing] = "/api/Hall/ChangeWing";
|
||||
dic_API[APIType.Hall_ChangeGodWar] = "/api/Hall/ChangeGodWar";
|
||||
dic_API[APIType.Hall_GetVipDayGift] = "/api/Hall/GetVipDayGift";
|
||||
dic_API[APIType.Hall_GetVipGift] = "/api/Hall/GetVipGift";
|
||||
dic_API[APIType.Hall_GetMonthCardDayGift] = "/api/Hall/GetMonthCardDayGift";
|
||||
dic_API[APIType.Hall_GetMonthCardGift] = "/api/Hall/GetMonthCardGift";
|
||||
dic_API[APIType.Hall_GetUserTaskList] = "/api/Hall/GetUserTaskList";
|
||||
dic_API[APIType.Hall_DistributeRewards] = "/api/Hall/DistributeRewards";
|
||||
|
||||
// ---------------- HubsReceive ----------------
|
||||
dic_API[APIType.Hubs_GetRoomList] = "/hubs/GetRoomList";
|
||||
dic_API[APIType.Hubs_JoinRoom] = "/hubs/JoinRoom";
|
||||
dic_API[APIType.Hubs_SyncGameData] = "/hubs/SyncGameData";
|
||||
dic_API[APIType.Hubs_ShootBullet] = "/hubs/ShootBullet";
|
||||
dic_API[APIType.Hubs_UseProp] = "/hubs/UseProp";
|
||||
dic_API[APIType.Hubs_KillFish] = "/hubs/KillFish";
|
||||
dic_API[APIType.Hubs_LeaveRoom] = "/hubs/LeaveRoom";
|
||||
dic_API[APIType.Hubs_ChangeGunMultiple] = "/hubs/ChangeGunMultiple";
|
||||
|
||||
// ---------------- HubsSend ----------------
|
||||
dic_API[APIType.Send_BindSuccess] = "/send/BindSuccess";
|
||||
dic_API[APIType.Send_ErrorMessage] = "/send/ErrorMessage";
|
||||
dic_API[APIType.Send_GetRoomListResult] = "/send/GetRoomListResult";
|
||||
dic_API[APIType.Send_KillNotice] = "/send/KillNotice";
|
||||
dic_API[APIType.Send_RoomChange] = "/send/RoomChange";
|
||||
dic_API[APIType.Send_RoomDisconnectNotice] = "/send/RoomDisconnectNotice";
|
||||
dic_API[APIType.Send_RoomJoinNotice] = "/send/RoomJoinNotice";
|
||||
dic_API[APIType.Send_RoomKillNotice] = "/send/RoomKillNotice";
|
||||
dic_API[APIType.Send_ChangeGunMultipleNotice] = "/send/ChangeGunMultipleNotice";
|
||||
dic_API[APIType.Send_RoomLeaveNotice] = "/send/RoomLeaveNotice";
|
||||
dic_API[APIType.Send_UsePropNotice] = "/send/UsePropNotice";
|
||||
dic_API[APIType.Send_SyncGameData] = "/send/SyncGameData";
|
||||
|
||||
// ---------------- ImageUpload ----------------
|
||||
dic_API[APIType.ImageUpload_Upload] = "/api/ImageUpload/upload";
|
||||
|
||||
// ---------------- Login ----------------
|
||||
dic_API[APIType.Login_GetAccessToken] = "/api/Login/GetAccessToken";
|
||||
dic_API[APIType.Login_GetSessionToken] = "/api/Login/GetSessionToken";
|
||||
dic_API[APIType.Login_RegisterWX] = "/api/Login/registerWX";
|
||||
dic_API[APIType.Login_Register] = "/api/Login/register";
|
||||
dic_API[APIType.Login_SendMobileCode] = "/api/Login/SendMobileCode";
|
||||
dic_API[APIType.Login_LoginWx] = "/api/Login/LoginWx";
|
||||
dic_API[APIType.Login_Login] = "/api/Login/Login";
|
||||
|
||||
// ---------------- Notice ----------------
|
||||
dic_API[APIType.Notice_Add] = "/api/Notice/add";
|
||||
dic_API[APIType.Notice_Update] = "/api/Notice/update";
|
||||
dic_API[APIType.Notice_Delete] = "/api/Notice/delete";
|
||||
dic_API[APIType.Notice_List] = "/api/Notice/list";
|
||||
dic_API[APIType.Notice_Get] = "/api/Notice/get";
|
||||
dic_API[APIType.Notice_GetNewOne] = "/api/Notice/get/newone";
|
||||
|
||||
// ---------------- System ----------------
|
||||
dic_API[APIType.System_AddUser] = "/api/System/user/add";
|
||||
}
|
||||
|
||||
// ---------------- GET ----------------
|
||||
static void GetSend<T>(string url, RequestParamBase request_Params, Action<T> action)
|
||||
{
|
||||
UIManager.Instance.StartCoroutine(IEGetSend<T>(url, request_Params, action));
|
||||
}
|
||||
|
||||
static IEnumerator IEGetSend<T>(string url, RequestParamBase paramObj, Action<T> action)
|
||||
{
|
||||
Debug.Log("url----" + url);
|
||||
// 将 RequestParamBase 转成 GET 参数
|
||||
if (paramObj != null)
|
||||
{
|
||||
var fields = paramObj.GetType().GetFields();
|
||||
List<string> paramList = new List<string>();
|
||||
|
||||
foreach (var f in fields)
|
||||
{
|
||||
object value = f.GetValue(paramObj);
|
||||
if (value != null)
|
||||
{
|
||||
string key = f.Name;
|
||||
string val = UnityWebRequest.EscapeURL(value.ToString());
|
||||
paramList.Add($"{key}={val}");
|
||||
}
|
||||
}
|
||||
|
||||
if (paramList.Count > 0)
|
||||
{
|
||||
url += "?" + string.Join("&", paramList);
|
||||
}
|
||||
}
|
||||
|
||||
using (UnityWebRequest req = UnityWebRequest.Get(url))
|
||||
{
|
||||
req.SetRequestHeader("Content-Type", "application/json");
|
||||
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
req.SetRequestHeader("token", token);
|
||||
|
||||
yield return req.SendWebRequest();
|
||||
|
||||
if (req.result == UnityWebRequest.Result.Success)
|
||||
{
|
||||
var json = req.downloadHandler.text;
|
||||
var res = JsonConvert.DeserializeObject<APIResponse<T>>(json);
|
||||
|
||||
// 自动保存 token
|
||||
if (typeof(T) == typeof(UserToken))
|
||||
{
|
||||
var ut = res.data as UserToken;
|
||||
if (ut != null) token = ut.token;
|
||||
Debug.Log("微信登录成功 Token" + token);
|
||||
|
||||
}
|
||||
Log(json + "\n------Get");
|
||||
if (res.code==0)
|
||||
{
|
||||
action?.Invoke(res.data);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorHandle(res.code, res.info);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(req.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- POST ----------------
|
||||
static void PostSend<T>(string url, APIRequest.RequestObjBase body, Action<T> action)
|
||||
{
|
||||
UIManager.Instance.StartCoroutine(IEPostSend<T>(url, body, action));
|
||||
}
|
||||
|
||||
static IEnumerator IEPostSend<T>(string url, APIRequest.RequestObjBase body, Action<T> action)
|
||||
{
|
||||
string upBodyJson = JsonConvert.SerializeObject(body);
|
||||
byte[] buff = Encoding.UTF8.GetBytes(upBodyJson);
|
||||
|
||||
using (UnityWebRequest req = new UnityWebRequest(url, "POST"))
|
||||
{
|
||||
req.SetRequestHeader("Content-Type", "application/json");
|
||||
req.downloadHandler = new DownloadHandlerBuffer();
|
||||
req.uploadHandler = new UploadHandlerRaw(buff);
|
||||
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
req.SetRequestHeader("token", token);
|
||||
|
||||
yield return req.SendWebRequest();
|
||||
|
||||
if (req.result == UnityWebRequest.Result.Success)
|
||||
{
|
||||
var json = req.downloadHandler.text;
|
||||
var res = JsonConvert.DeserializeObject<APIResponse<T>>(json);
|
||||
Log(json+"\n------Post");
|
||||
if (res.code == 0)
|
||||
{
|
||||
action?.Invoke(res.data);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorHandle(res.code, res.info);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(req.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- 调用入口 ----------------
|
||||
public static void Response<T>(APIType aPIType, RequestBase request, Action<T> action = null)
|
||||
{
|
||||
string url = baseURL + dic_API[aPIType];
|
||||
|
||||
if (request is RequestParamBase param)
|
||||
{
|
||||
GetSend<T>(url, param, action);
|
||||
}
|
||||
else if (request is APIRequest.RequestObjBase obj)
|
||||
{
|
||||
PostSend<T>(url, obj, action);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("RequestBase 不是 RequestParamBase 或 RequestObjBase");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 无参
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="apiType"></param>
|
||||
/// <param name="action"></param>
|
||||
public static void Response<T>(APIType apiType,Action<T> action = null)
|
||||
{
|
||||
string url = baseURL + dic_API[apiType];
|
||||
GetSend<T>(url, null, action);
|
||||
|
||||
}
|
||||
public static void Log(string json)
|
||||
{
|
||||
Debug.Log(json);
|
||||
}
|
||||
public static void ErrorHandle(int code,string message)
|
||||
{
|
||||
|
||||
|
||||
Debug.LogError("错误代码:"+code+"错误信息:"+message);
|
||||
//这里之后补弹窗
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13e79319d07e62540a5da3e05206d466
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3742b7952195f744ebe774b7ac6d9d9b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42d4a7f9bf0a99d4aa73e875deb5c681
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest.Objs
|
||||
{
|
||||
public class RegisterObj:RequestObjBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户手机号
|
||||
/// </summary>
|
||||
public string mobile;
|
||||
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
public string code;
|
||||
|
||||
/// <summary>
|
||||
/// 用户密码
|
||||
/// </summary>
|
||||
public string password;
|
||||
|
||||
/// <summary>
|
||||
/// 邀请码(可选)
|
||||
/// </summary>
|
||||
public string inviteCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f05dee8327f390345996e9bc6bd7b5e7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd3351faa7d08ac429fc7d0f591008cb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest.Params
|
||||
{
|
||||
/// <summary>
|
||||
/// 存入保险箱请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SaveSafeBoxParam : RequestParamBase
|
||||
{
|
||||
|
||||
public int amount; // 存入金额
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置保险箱密码请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SetSafeBoxPasswordParam : RequestParamBase
|
||||
{
|
||||
public string newPwd; // 新密码
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置保险箱密码请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ResetSafeBoxPasswordParam : RequestParamBase
|
||||
{
|
||||
public string code; // 验证码
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 合成碎片请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SynthesisFragmentParam : RequestParamBase
|
||||
{
|
||||
public int fragmentId; // 碎片ID
|
||||
public int count; // 数量
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买月卡请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BuyMonthCardParam : RequestParamBase
|
||||
{
|
||||
public int cardType; // 月卡类型
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买道具请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BuyPropParam : RequestParamBase
|
||||
{
|
||||
public int propId; // 道具ID
|
||||
public int count; // 数量
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买金币请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BuyGoldParam : RequestParamBase
|
||||
{
|
||||
|
||||
public int goldAmount; // 金币数量
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买钻石请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BuyDiamondParam : RequestParamBase
|
||||
{
|
||||
|
||||
public int diamondAmount; // 钻石数量
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 切换炮台请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ChangeCannonParam : RequestParamBase
|
||||
{
|
||||
public int cannonId; // 炮台ID
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换翅膀请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ChangeWingParam : RequestParamBase
|
||||
{
|
||||
public int wingId; // 翅膀ID
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换战神请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ChangeGodWarParam : RequestParamBase
|
||||
{
|
||||
public int godWarId; // 战神ID
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发放奖励请求参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DistributeRewardsParam : RequestParamBase
|
||||
{
|
||||
public int rewardId; // 奖励ID
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3271e3fbc41bdd48a1570c8a3590cda
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest.Params
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录接口请求参数(GET)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class LoginParam : RequestParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户手机号
|
||||
/// </summary>
|
||||
public string mobile;
|
||||
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
public string code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 582e61a25f518f442a86676473262ce0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest.Params
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信登录参数(GET)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class LoginWxParam : RequestParamBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信 openId
|
||||
/// </summary>
|
||||
public string openId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29497cb62414e664b9ec5ac7bfcaca31
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest
|
||||
{
|
||||
[Serializable]
|
||||
public class RequestBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d4ba79dcbbaf7d44be612f1ab08165d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest
|
||||
{
|
||||
[Serializable]
|
||||
public class RequestObjBase : RequestBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82c03efb419bc1441a9ed94d1415e341
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIRequest
|
||||
{
|
||||
[Serializable]
|
||||
public class RequestParamBase: RequestBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1057f00523fe3a548b4e936a23c99113
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,215 @@
|
||||
using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest.Params;
|
||||
using Assets.MyGame.Scripts.Net.APIResponses;
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net
|
||||
{
|
||||
public static partial class APIRequestList
|
||||
{
|
||||
#region Hall
|
||||
|
||||
/// <summary>
|
||||
/// 存入保险箱(POST)
|
||||
/// 参数:用户ID、存入金额
|
||||
/// 返回:SafeBoxInfo(保险箱余额信息)
|
||||
/// </summary>
|
||||
public static void SaveSafeBox(SaveSafeBoxParam req, Action<SafeBoxInfo> callback)
|
||||
{
|
||||
APIManager.Response<SafeBoxInfo>(APIType.Hall_SaveSafeBox, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取保险箱信息(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:SafeBoxInfo(保险箱余额信息)
|
||||
/// </summary>
|
||||
public static void GetSafeBox(Action<SafeBoxInfo> callback)
|
||||
{
|
||||
APIManager.Response<SafeBoxInfo>(APIType.Hall_GetSafeBox, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置保险箱密码(POST)
|
||||
/// 参数:用户ID、新密码
|
||||
/// 返回:StringBaseResponse(操作结果信息)
|
||||
/// </summary>
|
||||
public static void SetSafeBoxPassword(SetSafeBoxPasswordParam req, Action<StringBaseResponse> callback)
|
||||
{
|
||||
APIManager.Response<StringBaseResponse>(APIType.Hall_SetSafeBoxPassword, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置保险箱密码(POST)
|
||||
/// 参数:用户ID、验证码
|
||||
/// 返回:StringBaseResponse(操作结果信息)
|
||||
/// </summary>
|
||||
public static void ResetSafeBoxPassword(ResetSafeBoxPasswordParam req, Action<StringBaseResponse> callback)
|
||||
{
|
||||
APIManager.Response<StringBaseResponse>(APIType.Hall_ResetSafeBoxPassword, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取救济金(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:GetReliefResponse(救济金数量、提示信息)
|
||||
/// </summary>
|
||||
public static void GetRelief(Action<GetReliefResponse> callback)
|
||||
{
|
||||
APIManager.Response<GetReliefResponse>(APIType.Hall_GetRelief, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合成碎片(POST)
|
||||
/// 参数:碎片ID、数量
|
||||
/// 返回:PropInfo(道具信息)
|
||||
/// </summary>
|
||||
public static void SynthesisFragment(SynthesisFragmentParam req, Action<PropInfo> callback)
|
||||
{
|
||||
APIManager.Response<PropInfo>(APIType.Hall_SynthesisFragment, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买月卡(POST)
|
||||
/// 参数:用户ID、月卡类型
|
||||
/// 返回:MonthCardInfo(月卡信息)
|
||||
/// </summary>
|
||||
public static void BuyMonthCard(BuyMonthCardParam req, Action<MonthCardInfo> callback)
|
||||
{
|
||||
APIManager.Response<MonthCardInfo>(APIType.Hall_BuyMonthCard, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买道具(POST)
|
||||
/// 参数:道具ID、数量
|
||||
/// 返回:PropInfo(道具信息)
|
||||
/// </summary>
|
||||
public static void BuyProp(BuyPropParam req, Action<PropInfo> callback)
|
||||
{
|
||||
APIManager.Response<PropInfo>(APIType.Hall_BuyProp, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买金币(POST)
|
||||
/// 参数:用户ID、金币数量
|
||||
/// 返回:GoldInfo(金币信息)
|
||||
/// </summary>
|
||||
public static void BuyGold(BuyGoldParam req, Action<GoldInfo> callback)
|
||||
{
|
||||
APIManager.Response<GoldInfo>(APIType.Hall_BuyGold, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 购买钻石(POST)
|
||||
/// 参数:用户ID、钻石数量
|
||||
/// 返回:DiamondInfo(钻石信息)
|
||||
/// </summary>
|
||||
public static void BuyDiamond(BuyDiamondParam req, Action<DiamondInfo> callback)
|
||||
{
|
||||
APIManager.Response<DiamondInfo>(APIType.Hall_BuyDiamond, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 签到(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:SignInfo(签到结果)
|
||||
/// </summary>
|
||||
public static void SignIn(Action<SignInfo> callback)
|
||||
{
|
||||
APIManager.Response<SignInfo>(APIType.Hall_SignIn, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换炮台(POST)
|
||||
/// 参数:炮台ID
|
||||
/// 返回:UserInfo(用户信息)
|
||||
/// </summary>
|
||||
public static void ChangeCannon(ChangeCannonParam req, Action<UserInfo> callback)
|
||||
{
|
||||
APIManager.Response<UserInfo>(APIType.Hall_ChangeCannon, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换翅膀(POST)
|
||||
/// 参数:翅膀ID
|
||||
/// 返回:UserInfo(用户信息)
|
||||
/// </summary>
|
||||
public static void ChangeWing(ChangeWingParam req, Action<UserInfo> callback)
|
||||
{
|
||||
APIManager.Response<UserInfo>(APIType.Hall_ChangeWing, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换战神(POST)
|
||||
/// 参数:战神ID
|
||||
/// 返回:UserInfo(用户信息)
|
||||
/// </summary>
|
||||
public static void ChangeGodWar(ChangeGodWarParam req, Action<UserInfo> callback)
|
||||
{
|
||||
APIManager.Response<UserInfo>(APIType.Hall_ChangeGodWar, req, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取 Vip 每日礼包(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:GiftInfo(礼包信息)
|
||||
/// </summary>
|
||||
public static void GetVipDayGift( Action<GiftInfo> callback)
|
||||
{
|
||||
APIManager.Response<GiftInfo>(APIType.Hall_GetVipDayGift, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取 Vip 权益礼包(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:GiftInfo(礼包信息)
|
||||
/// </summary>
|
||||
public static void GetVipGift(Action<GiftInfo> callback)
|
||||
{
|
||||
APIManager.Response<GiftInfo>(APIType.Hall_GetVipGift, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取月卡每日礼包(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:GiftInfo(礼包信息)
|
||||
/// </summary>
|
||||
public static void GetMonthCardDayGift(Action<GiftInfo> callback)
|
||||
{
|
||||
APIManager.Response<GiftInfo>(APIType.Hall_GetMonthCardDayGift, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取月卡权益礼包(GET)
|
||||
/// 参数:用户ID
|
||||
/// 返回:GiftInfo(礼包信息)
|
||||
/// </summary>
|
||||
public static void GetMonthCardGift( Action<GiftInfo> callback)
|
||||
{
|
||||
APIManager.Response<GiftInfo>(APIType.Hall_GetMonthCardGift,callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户任务列表(Get)
|
||||
/// 参数:用户ID
|
||||
/// 返回:UserTaskListResponse(任务列表)
|
||||
/// </summary>
|
||||
public static void GetUserTaskList(Action<UserTaskListResponse> callback)
|
||||
{
|
||||
APIManager.Response<UserTaskListResponse>(APIType.Hall_GetUserTaskList, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发放奖励(POST)
|
||||
/// 参数:奖励ID、用户ID
|
||||
/// 返回:RewardInfo(奖励信息)
|
||||
/// </summary>
|
||||
public static void DistributeRewards(DistributeRewardsParam req, Action<RewardInfo> callback)
|
||||
{
|
||||
APIManager.Response<RewardInfo>(APIType.Hall_DistributeRewards, req, callback);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ccf916a5fe02f224cb8bff2eb884319a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest.Params;
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net
|
||||
{
|
||||
public static partial class APIRequestList
|
||||
{
|
||||
static void lizi()
|
||||
{
|
||||
APIRequestList.Login(
|
||||
new LoginParam { mobile = "13800138000", code = "1234" },
|
||||
res =>
|
||||
{
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
APIRequestList.Register(
|
||||
new RegisterObj { mobile = "13800138000", code = "1234", password = "abc123" },
|
||||
res =>
|
||||
{
|
||||
|
||||
}
|
||||
);
|
||||
APIRequestList.LoginWx(
|
||||
new LoginWxParam
|
||||
{
|
||||
openId = "wx_openid_123456"
|
||||
},
|
||||
res =>
|
||||
{
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
#region Login
|
||||
/// <summary>
|
||||
/// 微信用户登录(GET)
|
||||
/// Swagger Summary: 微信用户登陆
|
||||
/// 参数:
|
||||
/// openId: 微信 openId
|
||||
/// 返回:
|
||||
/// UserToken(包含 token、用户信息等)
|
||||
/// </summary>
|
||||
public static void LoginWx(LoginWxParam req, Action<UserToken> callback)
|
||||
{
|
||||
APIManager.Response<UserToken>(APIType.Login_LoginWx, req, obj =>
|
||||
{
|
||||
GameManager.Instance.user = obj;
|
||||
callback?.Invoke(obj);
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 登录(GET)
|
||||
/// </summary>
|
||||
public static void Login(LoginParam req, Action<UserToken> callback)
|
||||
{
|
||||
APIManager.Response<UserToken>(APIType.Login_Login, req, obj =>
|
||||
{
|
||||
GameManager.Instance.user=obj;
|
||||
callback?.Invoke(obj);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册(POST)
|
||||
/// </summary>
|
||||
public static void Register(RegisterObj req, Action<UserToken> callback)
|
||||
{
|
||||
APIManager.Response<UserToken>(APIType.Login_Register, req, obj =>
|
||||
{
|
||||
callback?.Invoke(obj);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 893fcc8ccbbc2194a900551eee4164d9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2d510566bde68b4eb5922f232f2dc88
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
[Serializable]
|
||||
public class APIResponse<T>
|
||||
{
|
||||
public int code;
|
||||
public string info;
|
||||
public T data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7729fa2401e95b247aa79db094c509ad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API
|
||||
{
|
||||
public class APIRespostData<T>
|
||||
{
|
||||
public APIType aPIType;
|
||||
public APIResponse<T> Data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: feff170bf46dafa47b471092d653db0b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70b880f328074264aac7137d78c21612
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 鱼的类型枚举类
|
||||
/// </summary>
|
||||
public enum FishTypeEnum
|
||||
{
|
||||
普通鱼=1,
|
||||
Boss鱼=2,
|
||||
黄金鱼=3,
|
||||
特殊鱼=4
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f8e11d6652a9884d90b2ddeff055fd1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏类型枚举
|
||||
/// </summary>
|
||||
public enum GameTypeEnum
|
||||
{
|
||||
风雷之渊=1,
|
||||
太古仙墟=2,
|
||||
中国象棋=3,
|
||||
星际迷航=4,
|
||||
黑神话悟空=5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5d1299a2705b9e4bb77c001c11815cf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 产品分类枚举
|
||||
/// </summary>
|
||||
public enum ProductTypeEnum
|
||||
{
|
||||
炮台=1,
|
||||
翅膀=2,
|
||||
炮塔碎片 = 3,
|
||||
翅膀碎片=4,
|
||||
战神=5,
|
||||
战神碎片=6,
|
||||
刮刮卡=7,
|
||||
改名卡=8,
|
||||
大喇叭=9,
|
||||
技能=10,
|
||||
召唤卡=11,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26eed7fc3646cc84cbd8f11d4f8dc072
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 售卖方式
|
||||
/// </summary>
|
||||
public enum SaleTypeEnum
|
||||
{
|
||||
金币=1,
|
||||
钻石=2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6720e06fa5b608c40826dfdd0216d998
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务类型枚举
|
||||
/// </summary>
|
||||
public enum TaskType
|
||||
{
|
||||
|
||||
每日任务=1,
|
||||
在线时长任务=2
|
||||
}
|
||||
/// <summary>
|
||||
/// 任务事件
|
||||
/// </summary>
|
||||
public enum TaskEvent
|
||||
{
|
||||
整点在线奖励=1,
|
||||
在线时长=2,
|
||||
捕获任意鱼=3,
|
||||
捕获黄金鱼 =4,
|
||||
捕获Boss鱼=5,
|
||||
赢取金币=6,
|
||||
使用狂暴=7,
|
||||
开炮任务=8,
|
||||
登录任务=9,
|
||||
充值任务=10
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb25f2597de78114391b5a31d9655e26
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户资产变动类型枚举类
|
||||
/// </summary>
|
||||
public enum UserAssetChangeTypeEnum
|
||||
{
|
||||
增加=1,
|
||||
减少=2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad19ad2134b48ce40a44874609200aac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,99 @@
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using Assets.MyGame.Scripts.Net.API.UserData_SubClass;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
namespace Assets.MyGame.Scripts.Net.API
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏后台配置(Unity 解析版)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GameConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据id(来自 MongoBaseEntity)
|
||||
/// </summary>
|
||||
public string id;
|
||||
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
public bool isDelete;
|
||||
|
||||
/// <summary>
|
||||
/// 创建人信息
|
||||
/// </summary>
|
||||
public OptionUserInfo createInfo;
|
||||
|
||||
/// <summary>
|
||||
/// 鱼种配置
|
||||
/// </summary>
|
||||
public List<FishTypeConfig> fishTypeConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 房间配置
|
||||
/// </summary>
|
||||
public List<RoomConfig> roomConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 出鱼配置
|
||||
/// </summary>
|
||||
public List<RoomFishConfig> roomFishConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 鱼阵配置
|
||||
/// </summary>
|
||||
public List<FishArrayConfig> fishArrayConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 用户等级配置
|
||||
/// </summary>
|
||||
public List<UserLevelConfig> userLevelConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 道具表
|
||||
/// </summary>
|
||||
public List<PropInfConfig> propConfig;
|
||||
|
||||
/// <summary>
|
||||
/// 道具碎片表
|
||||
/// </summary>
|
||||
public List<PropFragmentConfig> propFragments;
|
||||
|
||||
/// <summary>
|
||||
/// Vip等级配置
|
||||
/// </summary>
|
||||
public List<VipLevelConfig> vipLevelConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 签到池配置
|
||||
/// </summary>
|
||||
public List<SignConfig> signConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 月卡配置
|
||||
/// </summary>
|
||||
public List<MonthCardConfig> monthCardConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 救济金配置
|
||||
/// </summary>
|
||||
public ReliefConfig reliefConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 金币商城配置
|
||||
/// </summary>
|
||||
public List<GoldShopConfig> goldShopConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// 钻石商城配置
|
||||
/// </summary>
|
||||
public List<DiamondShopConfig> diamondShopConfigs;
|
||||
/// <summary>
|
||||
/// 击杀配置
|
||||
/// </summary>
|
||||
|
||||
public object killConfig ;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d64884df8d4ebb4a840178a14ebb3bc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60ccdcd2dfde0fe43b3aea0b089a06b7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础商品信息
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BaseProduct
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品编号
|
||||
/// </summary>
|
||||
public string number;
|
||||
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string desc;
|
||||
|
||||
/// <summary>
|
||||
/// 图片地址
|
||||
/// </summary>
|
||||
public string imageUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 商品类型
|
||||
/// </summary>
|
||||
public int type;
|
||||
|
||||
/// <summary>
|
||||
/// 道具等级
|
||||
/// </summary>
|
||||
public int level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d4070515a8b636408308ff933825acb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品 + 数量
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BaseProductCount : BaseProduct
|
||||
{
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public int count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 345e08ff5b63d2747bb8c95beca337bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 道具基础信息
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class BasePropInfo : BaseProduct
|
||||
{
|
||||
/// <summary>
|
||||
/// 售卖方式(金币/钻石)
|
||||
/// </summary>
|
||||
public int saleType;
|
||||
|
||||
/// <summary>
|
||||
/// 售卖价格
|
||||
/// </summary>
|
||||
public int price;
|
||||
|
||||
/// <summary>
|
||||
/// 售卖数量
|
||||
/// </summary>
|
||||
public int saleCount;
|
||||
|
||||
/// <summary>
|
||||
/// 会员价格
|
||||
/// </summary>
|
||||
public int vipPrice;
|
||||
|
||||
/// <summary>
|
||||
/// 经销商价格
|
||||
/// </summary>
|
||||
public int dealerPrice;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool isEnable;
|
||||
|
||||
/// <summary>
|
||||
/// 是否销售
|
||||
/// </summary>
|
||||
public bool isSale;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe471ad901872af45b56ba9eebbbd599
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 钻石商城配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DiamondShopConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品编号
|
||||
/// </summary>
|
||||
public string number;
|
||||
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// 图标地址
|
||||
/// </summary>
|
||||
public string icon;
|
||||
|
||||
/// <summary>
|
||||
/// 钻石数量
|
||||
/// </summary>
|
||||
public int diamond;
|
||||
|
||||
/// <summary>
|
||||
/// 现金价格
|
||||
/// </summary>
|
||||
public double money;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ba6f28a1e8c9dc4a8d524dec60ea4ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 鱼阵配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class FishArrayConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 鱼阵编号
|
||||
/// </summary>
|
||||
public string fishArrayNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// Boss鱼编号
|
||||
/// </summary>
|
||||
public string bossFishNumber;
|
||||
|
||||
/// <summary>
|
||||
/// Boss数量
|
||||
/// </summary>
|
||||
public int boosCount;
|
||||
|
||||
/// <summary>
|
||||
/// 普通鱼编号
|
||||
/// </summary>
|
||||
public string fishNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 普通鱼数量
|
||||
/// </summary>
|
||||
public int fishCount;
|
||||
|
||||
/// <summary>
|
||||
/// 阵型编号
|
||||
/// </summary>
|
||||
public string arrayNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 路径集合
|
||||
/// </summary>
|
||||
public List<int> pathList;
|
||||
|
||||
/// <summary>
|
||||
/// 阈值集合
|
||||
/// </summary>
|
||||
public List<int> thresholdList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5ebaae18a483ab47b8c2d921c75ce24
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 鱼种配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class FishTypeConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 鱼种编号
|
||||
/// </summary>
|
||||
public string fishNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 鱼名字
|
||||
/// </summary>
|
||||
public string fishName;
|
||||
|
||||
/// <summary>
|
||||
/// 鱼类型(普通鱼/Boss鱼/黄金鱼…)
|
||||
/// </summary>
|
||||
public int fishType;
|
||||
|
||||
/// <summary>
|
||||
/// 基础分数
|
||||
/// </summary>
|
||||
public int fishScore;
|
||||
|
||||
/// <summary>
|
||||
/// 击杀权重
|
||||
/// </summary>
|
||||
public int killWeight;
|
||||
|
||||
/// <summary>
|
||||
/// 路径编号集合
|
||||
/// </summary>
|
||||
public List<int> pathList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 082fb3f96c7ba4a42abd4a7c4b7bad68
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 礼包配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GiftConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型 1 金币 2 钻石 3 道具
|
||||
/// </summary>
|
||||
public int type;
|
||||
|
||||
/// <summary>
|
||||
/// 是否随机
|
||||
/// </summary>
|
||||
public bool isRandom;
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public int count;
|
||||
|
||||
/// <summary>
|
||||
/// 随机最小数量
|
||||
/// </summary>
|
||||
public int minCount;
|
||||
|
||||
/// <summary>
|
||||
/// 随机最大数量
|
||||
/// </summary>
|
||||
public int maxCount;
|
||||
|
||||
/// <summary>
|
||||
/// 道具信息
|
||||
/// </summary>
|
||||
public BaseProduct product;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4043529f7458ef47bbece3656ac4649
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 金币商城配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GoldShopConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品编号
|
||||
/// </summary>
|
||||
public string number;
|
||||
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// 图标地址
|
||||
/// </summary>
|
||||
public string icon;
|
||||
|
||||
/// <summary>
|
||||
/// 金币数量
|
||||
/// </summary>
|
||||
public int gold;
|
||||
|
||||
/// <summary>
|
||||
/// 钻石数量
|
||||
/// </summary>
|
||||
public int diamond;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4661e3c8eb25134db2cc4d38bfb2ccf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 月卡配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class MonthCardConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型 1 周卡 2 月卡 3 年卡
|
||||
/// </summary>
|
||||
public int type;
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// 签到加成
|
||||
/// </summary>
|
||||
public double signInAdd;
|
||||
|
||||
/// <summary>
|
||||
/// 金币价格
|
||||
/// </summary>
|
||||
public int gold;
|
||||
|
||||
/// <summary>
|
||||
/// 现金价格
|
||||
/// </summary>
|
||||
public double money;
|
||||
|
||||
/// <summary>
|
||||
/// 权益礼包
|
||||
/// </summary>
|
||||
public List<GiftConfig> giftList;
|
||||
|
||||
/// <summary>
|
||||
/// 每日礼包
|
||||
/// </summary>
|
||||
public List<GiftConfig> dailyGift;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cb9abc4d759de54ab588e82ddbed12a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 道具碎片信息
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PropFragmentConfig : BasePropInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 合成所需碎片数量
|
||||
/// </summary>
|
||||
public int fragmentCount;
|
||||
|
||||
/// <summary>
|
||||
/// 合成后的道具编号
|
||||
/// </summary>
|
||||
public string productNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f6d51567ed0d2847a7db6c106a23d89
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 道具信息
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PropInfConfig : BasePropInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联游戏编号(空表示全部)
|
||||
/// </summary>
|
||||
public List<string> gameNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 有效期(天)0 表示不限
|
||||
/// </summary>
|
||||
public int day;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5d184d1a6181124c9f4d81db847f73b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 救济金配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ReliefConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否开启
|
||||
/// </summary>
|
||||
public bool isOpen;
|
||||
|
||||
/// <summary>
|
||||
/// 金币数量
|
||||
/// </summary>
|
||||
public int gold;
|
||||
|
||||
/// <summary>
|
||||
/// 每天可领取次数
|
||||
/// </summary>
|
||||
public int count;
|
||||
|
||||
/// <summary>
|
||||
/// 领取金币限制
|
||||
/// </summary>
|
||||
public int limit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 522d03f24a0d8ed4eaae222d23b7c108
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 房间配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RoomConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 房间编号
|
||||
/// </summary>
|
||||
public string roomNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 房间名称
|
||||
/// </summary>
|
||||
public string roomName;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏类型
|
||||
/// </summary>
|
||||
public int gameType;
|
||||
|
||||
/// <summary>
|
||||
/// 房间等级
|
||||
/// </summary>
|
||||
public int roomLevel;
|
||||
|
||||
/// <summary>
|
||||
/// 房间分区数量
|
||||
/// </summary>
|
||||
public int roomPartitionNum;
|
||||
|
||||
/// <summary>
|
||||
/// 房间数量
|
||||
/// </summary>
|
||||
public int roomCount;
|
||||
|
||||
/// <summary>
|
||||
/// 进房金币限制
|
||||
/// </summary>
|
||||
public int roomGoldLimit;
|
||||
|
||||
/// <summary>
|
||||
/// 炮倍列表
|
||||
/// </summary>
|
||||
public List<int> cannonMultipleList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f2a7671a295f384880ade38316e7808
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 出鱼配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RoomFishConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏类型
|
||||
/// </summary>
|
||||
public int gameType;
|
||||
/// <summary>
|
||||
/// 时间/速度
|
||||
/// </summary>
|
||||
public float times;
|
||||
/// <summary>
|
||||
/// 普通鱼配置列表
|
||||
/// </summary>
|
||||
public List<RoomFishDetailConfig> normalFishList;
|
||||
|
||||
/// <summary>
|
||||
/// 按房间等级出鱼配置
|
||||
/// </summary>
|
||||
public List<RoomFishLevelConfig> roomFishLevelList;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63c2f86f34f940e41b3d14d5bf538c69
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 出鱼配置详情
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RoomFishDetailConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型 1 鱼 2 鱼阵
|
||||
/// </summary>
|
||||
public int type;
|
||||
|
||||
/// <summary>
|
||||
/// 鱼种编号或鱼阵编号
|
||||
/// </summary>
|
||||
public string fishNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 出鱼权重
|
||||
/// </summary>
|
||||
public int fishWeight;
|
||||
|
||||
/// <summary>
|
||||
/// 出鱼频率(秒)
|
||||
/// </summary>
|
||||
public int fishFrequency;
|
||||
|
||||
/// <summary>
|
||||
/// 场内最大数量
|
||||
/// </summary>
|
||||
public int maxCount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f9afa9fe7016204f89639dd48cda883
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 按房间等级出鱼配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RoomFishLevelConfig : RoomFishDetailConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 房间等级
|
||||
/// </summary>
|
||||
public int roomLevel;
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3c44b177e5626645b677bfe731e4bac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 签到奖励配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SignConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int order;
|
||||
|
||||
/// <summary>
|
||||
/// 金币
|
||||
/// </summary>
|
||||
public int gold;
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public string icon;
|
||||
|
||||
/// <summary>
|
||||
/// 概率
|
||||
/// </summary>
|
||||
public double probability;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 540cb55ff2a240549873c94ba0690fef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户等级配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class UserLevelConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 等级
|
||||
/// </summary>
|
||||
public int level;
|
||||
|
||||
/// <summary>
|
||||
/// 经验下限
|
||||
/// </summary>
|
||||
public int expMin;
|
||||
|
||||
/// <summary>
|
||||
/// 经验上限
|
||||
/// </summary>
|
||||
public int expMax;
|
||||
|
||||
/// <summary>
|
||||
/// 奖励金币
|
||||
/// </summary>
|
||||
public int gold;
|
||||
|
||||
/// <summary>
|
||||
/// 奖励钻石
|
||||
/// </summary>
|
||||
public int diamond;
|
||||
|
||||
/// <summary>
|
||||
/// 奖励道具列表
|
||||
/// </summary>
|
||||
public List<BaseProductCount> productList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1412a82019c424459e474ee47945762
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API.GameConfig_SubClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Vip等级配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class VipLevelConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Vip等级
|
||||
/// </summary>
|
||||
public int level;
|
||||
|
||||
/// <summary>
|
||||
/// 经验上限
|
||||
/// </summary>
|
||||
public int expMax;
|
||||
|
||||
/// <summary>
|
||||
/// 经验下限
|
||||
/// </summary>
|
||||
public int expMin;
|
||||
|
||||
/// <summary>
|
||||
/// 签到加成
|
||||
/// </summary>
|
||||
public double signInAdd;
|
||||
|
||||
/// <summary>
|
||||
/// Vip等级礼包
|
||||
/// </summary>
|
||||
public List<GiftConfig> giftList;
|
||||
|
||||
/// <summary>
|
||||
/// 每日礼包
|
||||
/// </summary>
|
||||
public List<GiftConfig> dailyGift;
|
||||
public string remark;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b227fdfbcbd6274ab9dccf9157a4c82
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.APIResponses
|
||||
{
|
||||
/// <summary>
|
||||
/// 保险箱信息(存取款通用)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SafeBoxInfo
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public int balance; // 保险箱余额
|
||||
public int bagBalance; // 背包余额(如果接口返回)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通用字符串响应(设置密码、重置密码等)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class StringBaseResponse
|
||||
{
|
||||
public int code; // 状态码
|
||||
public string message; // 提示信息
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 救济金领取响应
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GetReliefResponse
|
||||
{
|
||||
public int reliefAmount; // 领取的救济金数量
|
||||
public int leftTimes; // 剩余可领取次数
|
||||
public string message; // 提示信息
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 道具信息(购买道具、合成碎片)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PropInfo
|
||||
{
|
||||
public int propId; // 道具ID
|
||||
public string name; // 道具名称
|
||||
public string desc; // 描述
|
||||
public string icon; // 图标地址
|
||||
public int type; // 类型
|
||||
public int level; // 等级
|
||||
public int count; // 数量
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 月卡信息(购买月卡)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class MonthCardInfo
|
||||
{
|
||||
public int cardId; // 月卡ID
|
||||
public string name; // 月卡名称
|
||||
public int days; // 有效天数
|
||||
public DateTime expireTime; // 到期时间
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 金币购买响应
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GoldInfo
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public int gold; // 当前金币
|
||||
public int addGold; // 本次增加金币
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 钻石购买响应
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DiamondInfo
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public int diamond; // 当前钻石
|
||||
public int addDiamond; // 本次增加钻石
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 签到响应
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SignInfo
|
||||
{
|
||||
public int day; // 第几天签到
|
||||
public bool isToday; // 今日是否已签到
|
||||
public int rewardGold; // 奖励金币
|
||||
public int rewardDiamond;// 奖励钻石
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户信息(切换炮台、翅膀、战神)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class UserInfo
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public string nickname; // 昵称
|
||||
public int level; // 等级
|
||||
public int cannonId; // 当前炮台
|
||||
public int wingId; // 当前翅膀
|
||||
public int godWarId; // 当前战神
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 礼包信息(Vip礼包、月卡礼包)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GiftInfo
|
||||
{
|
||||
public int giftId; // 礼包ID
|
||||
public string name; // 礼包名称
|
||||
public string desc; // 礼包描述
|
||||
public PropInfo[] items; // 礼包内物品
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户任务列表响应
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class UserTaskListResponse
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public TaskInfo[] tasks; // 任务列表
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单个任务信息
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class TaskInfo
|
||||
{
|
||||
public int taskId; // 任务ID
|
||||
public string name; // 任务名称
|
||||
public string desc; // 描述
|
||||
public int progress; // 当前进度
|
||||
public int target; // 完成目标
|
||||
public bool isCompleted; // 是否完成
|
||||
public bool isReceived; // 是否领取奖励
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发放奖励响应
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RewardInfo
|
||||
{
|
||||
public int rewardId; // 奖励ID
|
||||
public string name; // 奖励名称
|
||||
public PropInfo[] items; // 奖励物品
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user