This commit is contained in:
hyskai 2024-11-03 17:17:24 +08:00
parent d06e80bb4c
commit 14b6bb128d
12 changed files with 1326 additions and 48 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 9aaf93beba8dd1a4797b67dee38c97e4
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: b87eb5ed7d0f2864d9223218fadf02ef
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 38e6b85e401c08f4eb5938aa19e72515
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ public class boy : mount
{
//²âÊÔÓÃ
Login login = new Login();
login.Phone = "test1";
login.Phone = "1111";
await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
@ -52,13 +52,14 @@ public class boy : mount
if (currencType == 0)//½ð±Ò
{
allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGold", "POST");
// Debug.Log(allfisherman);
}
else//±¦Ê¯
{
allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGem", "POST");
// Debug.Log(allfisherman);
}
//Debug.Log(allfisherman);
Debug.Log(allfisherman);
Response allfishermanres = JsonUtility.FromJson<Response>(allfisherman);
//Debug.Log(Struct.StructToString(allfishermanres, 1));
foreach (Item item in allfishermanres.List)

View File

@ -170,7 +170,9 @@ public class landContorl : MonoBehaviour
fishMan = GameObject.Instantiate(fishManPrefab);
fishMan.transform.position = endPos.position;
fishManShipContorl = fishMan.GetComponent<shipcontorl>();
MoveToStartPos();
fishManShipContorl.UpShowTimer(timerStr);
StartCoroutine(Fishing());
return;
}
@ -240,17 +242,25 @@ public class landContorl : MonoBehaviour
IEnumerator Fishing()
{
fishMan.GetComponent<shipcontorl>().SetState(ShipState.shipthrow);
// 创建一个摆动效果的 Tween
//注意 ,摆动动的是船,移动移动是根节点
var swayTween = fishManShipContorl.Man.transform.DOLocalRotate(new Vector3(0, 0, 10), 1f, RotateMode.LocalAxisAdd) // 每次摆动角度
.SetEase(Ease.InOutSine)
.SetLoops(-1, LoopType.Yoyo); // 无限往复
fishMan.GetComponent<shipcontorl>().SetState(ShipState.shipthrow);
yield return new WaitForSeconds(1f);
fishMan.GetComponent<shipcontorl>().SetState(ShipState.stand);
// 等待捕鱼指定时间
yield return new WaitForSeconds(fishingNeedTimer-1f);
// 停止摆动效果
swayTween.Kill();
// 返回起点
MoveToStartPos();
// MoveToStartPos();
}

View File

@ -18,7 +18,7 @@ public class boy_jinsha:mount
{
//²âÊÔÓÃ
Login login = new Login();
login.Phone = "tast4";
login.Phone = "tast5";
await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
@ -72,7 +72,7 @@ public class boy_jinsha:mount
{
if (gameObject.GetComponent<landContorl_jinsha>().ActivateValue == item.ActivateValue)//Èç¹û¼Û¸ñÒ»ÖÂ
{
Debug.Log(item.RemainEndureTime.ToString() + '/' + item.EndureTime.ToString());
//Debug.Log(item.RemainEndureTime.ToString() + '/' + item.EndureTime.ToString());
gameObject.GetComponent<landContorl_jinsha>().add_fish(item.RemainEndureTime.ToString() + '/' + item.EndureTime.ToString());
}
}

View File

@ -6,45 +6,61 @@ using TMPro;
public class landContorl_jinsha : MonoBehaviour
{
[Header("渔船的预制体")]
public GameObject fishManPrefab;
private GameObject fishMan;
private shipcontorl fishManShipContorl;
private GameObject fishMan;//生成的渔船
private shipcontorl fishManShipContorl;//渔船的控制器
[Header("渔船生成点")]
public Transform startPos;
[Header("渔船终点")]
public Transform endPos;
[Header("岛屿类型编号")]
public int type;
public bool isbuy = false;
// public bool isGoldLand = false;
public float ActivateValue = 0;
public int Num = 0;
public int Type = 0;
//路径
[Header("渔船航行路径点集合")]
public List<Path> paths;
//航行时间
[Header("航行时间")]
public float pathsNeedTimer = 30f;
//捕鱼时间
[Header("捕鱼时间")]
public float fishingNeedTimer = 30f;
//休息时间
public float restTimer = 5f;
//每次获得的金币数量默认100
public int getgoldnumber = 100;
[Header("休息时间")]
public float restTimer = 5f;
public GameObject goldshop;
[Header("显示金币数量")]
public TextMeshPro goldNumerTextPro;
public GameObject HightLight;//高亮
[Header("显示船只数量")]
public TextMeshPro shipNumberTextPro;
public int shipNumber = 0;
[Header("点击的高亮图层")]
public GameObject HightLight;//高亮图层
public Transform Btntrans;
public float FishPrice;
public GameObject map;
public static bool canClick=true;
// Start is called before the first frame update
private void Start()
@ -52,11 +68,7 @@ public class landContorl_jinsha : MonoBehaviour
FishPrice = 10;
if (goldshop == null)
{
Debug.LogError("goldshop==null");
return;
}
HightLight.SetActive(false);
@ -111,6 +123,7 @@ public class landContorl_jinsha : MonoBehaviour
}
else
{
//Promptmgr.Instance.PromptBubble("购买失败", Color.black, Color.red);
Promptmgr.Instance.PromptBubble(res.ErrorMessage, Color.black, Color.red);
}
}
@ -125,20 +138,29 @@ public class landContorl_jinsha : MonoBehaviour
}
private void OnMouseDown()
{
{
OnClick();
}
private void OnTouch()
{
{
OnClick();
}
private void OnClick()
{
if(!isbuy)
if (!canClick)
{
return;
}
if (fishMan != null)
{
Promptmgr.Instance.PromptBubble("已经有船了", Color.black, Color.red);
return;
}
if (!isbuy)
{
Promptmgr.Instance.PromptBubble("还没有买船了", Color.black, Color.red);
return;
@ -156,7 +178,7 @@ public class landContorl_jinsha : MonoBehaviour
if (fishMan != null)
{
Promptmgr.Instance.PromptBubble("已经有船了", Color.black, Color.red);
//Promptmgr.Instance.PromptBubble("已经有船了", Color.black, Color.red);
fishManShipContorl.UpShowTimer(timerStr);
return;
}
@ -166,7 +188,9 @@ public class landContorl_jinsha : MonoBehaviour
fishMan = GameObject.Instantiate(fishManPrefab);
fishMan.transform.position = endPos.position;
fishManShipContorl = fishMan.GetComponent<shipcontorl>();
MoveToStartPos();
fishManShipContorl.UpShowTimer(timerStr);
StartCoroutine(Fishing());
this.isbuy = true;
@ -237,6 +261,12 @@ public class landContorl_jinsha : MonoBehaviour
IEnumerator Fishing()
{
// 创建一个摆动效果的 Tween
//注意 ,摆动动的是船,移动移动是根节点
var swayTween = fishManShipContorl.Man.transform.DOLocalRotate(new Vector3(0, 0, 10), 1f, RotateMode.LocalAxisAdd) // 每次摆动角度
.SetEase(Ease.InOutSine)
.SetLoops(-1, LoopType.Yoyo); // 无限往复
fishMan.GetComponent<shipcontorl>().SetState(ShipState.shipthrow);
@ -247,8 +277,11 @@ public class landContorl_jinsha : MonoBehaviour
// 等待捕鱼指定时间
yield return new WaitForSeconds(fishingNeedTimer - 1f);
// 停止摆动效果
// swayTween.Kill();
// 返回起点
MoveToStartPos();
//MoveToStartPos();
}
@ -258,7 +291,7 @@ public class landContorl_jinsha : MonoBehaviour
// 随机选择一条路径
Path selectedPath = paths[Random.Range(0, paths.Count)];
// 移动到捕鱼
// 移动到
StartCoroutine(MoveToStartPos(fishMan, selectedPath.pathPoints));
}
@ -303,6 +336,8 @@ public class landContorl_jinsha : MonoBehaviour
// 等待捕鱼指定时间
yield return new WaitForSeconds(restTimer);
// 停止摆动效果
swayTween.Kill();

View File

@ -7,6 +7,8 @@ public class shopman :mount
public static shopman instance;
public delegate void OnClikeWT(int type, int num);
public event OnClikeWT OnType;//点击事件
public List<Sprite> icon;
// Start is called before the first frame update
public override void Awake()
{
@ -18,18 +20,19 @@ public class shopman :mount
//关闭摄像头逻辑
Cinemachine_2dCon.SetCameraContorl(false);
Debug.LogError("禁用生成船只逻辑");
//Debug.LogError("禁用生成船只逻辑");
landContorl_jinsha.canClick = false;
List<BoxType> boxTypes = new List<BoxType>();
boxTypes.Add(new BoxType { Name = "矿工1文本", prompt = "第一层", Type = 4, is_required = true });
boxTypes.Add(new BoxType { Name = "矿工1", prompt = "初级精灵", Type = 3, is_required = true });
boxTypes.Add(new BoxType { Name = "矿工1", prompt = "初级精灵", Type = 3, is_required = true, icon = icon[0] });
boxTypes.Add(new BoxType { Name = "矿工1文本", prompt = "第二层", Type = 4, is_required = true });
boxTypes.Add(new BoxType { Name = "矿工1", prompt = "中级精灵", Type = 3, is_required = true });
boxTypes.Add(new BoxType { Name = "矿工1", prompt = "中级精灵", Type = 3, is_required = true, icon = icon[1] });
boxTypes.Add(new BoxType { Name = "矿工1文本", prompt = "第三层", Type = 4, is_required = true });
boxTypes.Add(new BoxType { Name = "矿工1", prompt = "高级精灵", Type = 3, is_required = true });
boxTypes.Add(new BoxType { Name = "矿工1", prompt = "高级精灵", Type = 3, is_required = true, icon = icon[2] });
@ -44,6 +47,7 @@ public class shopman :mount
{
//关闭摄像头逻辑
Cinemachine_2dCon.SetCameraContorl(true);
landContorl_jinsha.canClick = true;
};
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消