This commit is contained in:
hyskai 2024-10-30 01:19:18 +08:00
parent d598d04bba
commit 2e3c81564e
3 changed files with 409 additions and 29 deletions

View File

@ -1279,6 +1279,90 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &377816034
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 377816035}
- component: {fileID: 377816036}
m_Layer: 0
m_Name: icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &377816035
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 377816034}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.54, y: -0.04, z: -1}
m_LocalScale: {x: 0.6, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1780327003}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &377816036
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 377816034}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 6a0a2f486c805cd4883694ffa531db75, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2.18, y: 1.92}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &420796829
GameObject:
m_ObjectHideFlags: 0
@ -1510,6 +1594,7 @@ Transform:
m_Children:
- {fileID: 325072784}
- {fileID: 310426479}
- {fileID: 1780327003}
- {fileID: 740831122}
- {fileID: 1734571546}
- {fileID: 1005748196}
@ -1547,6 +1632,10 @@ MonoBehaviour:
- {fileID: 1576490689}
pathsNeedTimer: 3
fishingNeedTimer: 3
timeshop: {fileID: 740831121}
goldshop: {fileID: 1780327002}
CDTimer: {fileID: 1201934715}
goldNumer: {fileID: 979148971}
--- !u!61 &559443433
BoxCollider2D:
m_ObjectHideFlags: 0
@ -1690,7 +1779,7 @@ RectTransform:
- {fileID: 1201934714}
- {fileID: 2021984178}
m_Father: {fileID: 559443431}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -1769,7 +1858,7 @@ GameObject:
- component: {fileID: 784479838}
- component: {fileID: 784479837}
m_Layer: 0
m_Name: time
m_Name: gold
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -2270,6 +2359,178 @@ PolygonCollider2D:
- {x: 5.635036, y: -10.007969}
- {x: 5.6269174, y: 0.036475062}
- {x: 5.618172, y: 9.981446}
--- !u!1 &979148969
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 979148970}
- component: {fileID: 979148972}
- component: {fileID: 979148971}
m_Layer: 0
m_Name: text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &979148970
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 979148969}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1780327003}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &979148971
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 979148969}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 9999
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: c8f169cd16f459346964aab720dd2321, type: 2}
m_sharedMaterial: {fileID: -119483755500966471, guid: c8f169cd16f459346964aab720dd2321, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 4
m_fontSizeBase: 4
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
_SortingLayer: 0
_SortingLayerID: 0
_SortingOrder: 0
m_hasFontAssetChanged: 0
m_renderer: {fileID: 979148972}
m_maskType: 0
--- !u!23 &979148972
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 979148969}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -119483755500966471, guid: c8f169cd16f459346964aab720dd2321, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1005748195
GameObject:
m_ObjectHideFlags: 0
@ -2301,7 +2562,7 @@ Transform:
- {fileID: 327705043}
- {fileID: 815685643}
m_Father: {fileID: 559443431}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1048058357
GameObject:
@ -3791,7 +4052,7 @@ GameObject:
- component: {fileID: 1621691475}
- component: {fileID: 1621691474}
m_Layer: 0
m_Name: time
m_Name: gold
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -4262,7 +4523,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 559443431}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1752358035
GameObject:
@ -4539,6 +4800,106 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 1277910355122697997, guid: 70dafa78a5b6ebe4b816211824cf9bef, type: 3}
m_PrefabInstance: {fileID: 1780203632}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1780327002
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1780327003}
- component: {fileID: 1780327005}
- component: {fileID: 1780327004}
m_Layer: 0
m_Name: gold
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1780327003
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1780327002}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -1}
m_LocalScale: {x: 0.7702702, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 979148970}
- {fileID: 377816035}
m_Father: {fileID: 559443431}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.148, y: 1.505}
m_SizeDelta: {x: 1.65, y: 0.42}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1780327004
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1780327002}
m_CullTransparentMesh: 1
--- !u!212 &1780327005
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1780327002}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 4319f8a1771ef154db3f5b49657b9d57, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.65, y: 0.42}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1831132831
GameObject:
m_ObjectHideFlags: 0

View File

@ -21,16 +21,6 @@ public class Promptmgr : MonoBehaviour
}
/* public void PromptBubble(string message)
{
GameObject proobj = Instantiate(PromptPrefab);
proobj.transform.SetParent(GameObject.Find("Canvas").transform);
proobj.transform.position = new Vector3(540, 1300, 0);
StartCoroutine(MoveUpandDestory(proobj));
Text protext = proobj.transform.Find("Prompttext").GetComponent<Text>(); ;
protext.text = message;
}*/
public void PromptBubble(string message)
{
@ -47,7 +37,7 @@ public class Promptmgr : MonoBehaviour
{
GameObject proobj = Instantiate(PromptPrefab);
proobj.transform.SetParent(canvs.transform);
proobj.transform.position = new Vector3(540, 1300, 0);
proobj.transform.position = new Vector3(Screen.width / 2, Screen.height / 2 + 33, 0);
StartCoroutine(MoveUpandDestory(proobj));
Text protext = proobj.transform.Find("Prompttext").GetComponent<Text>();
@ -65,7 +55,7 @@ public class Promptmgr : MonoBehaviour
{
GameObject proobj = Instantiate(PromptWhiltePrefab);
proobj.transform.SetParent(canvs.transform);
proobj.transform.position = new Vector3(540, 1300, 0);
proobj.transform.position = new Vector3(Screen.width / 2, Screen.height / 2 + 33, 0);
StartCoroutine(MoveUpandDestory(proobj));
Text protext = proobj.transform.Find("Prompttext").GetComponent<Text>(); ;
protext.text = message;
@ -97,7 +87,4 @@ public class Promptmgr : MonoBehaviour
}
}

View File

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using TMPro;
[System.Serializable]
public class Path
@ -20,18 +21,35 @@ public class landContorl : MonoBehaviour
public List<Path> paths;
public float pathsNeedTimer = 30f;
public float fishingNeedTimer = 30f;
public GameObject timeshop;
public GameObject goldshop;
public float timer=0;
public float goldnumer=0;
public TextMeshPro CDTimerTextPro;
public TextMeshPro goldNumerTextPro;
// Start is called before the first frame update
void Start()
private void Start()
{
if (timeshop==null)
{
Debug.LogError("timeshop==null");
return;
}
if (goldshop == null)
{
Debug.LogError("goldshop==null");
return;
}
timeshop.SetActive(true);
goldshop.SetActive(false);
}
// Update is called once per frame
void Update()
{
}
private void OnMouseDown()
{
OnClick();
@ -43,6 +61,8 @@ public class landContorl : MonoBehaviour
void OnClick()
{
Debug.LogError("检测逻辑");
Debug.LogError("扣钱逻辑");
fishMan = GameObject.Instantiate(fishManPrefab);
fishMan.transform.SetParent(startPos);
@ -54,12 +74,17 @@ public class landContorl : MonoBehaviour
void MoveToFishingPos()
{
//开始计时
timer+= (pathsNeedTimer*2+ fishingNeedTimer);
// 随机选择一条路径
Path selectedPath = paths[Random.Range(0, paths.Count)];
// 移动到捕鱼点
StartCoroutine(MoveToFishingPoint(fishMan, selectedPath.pathPoints));
}
IEnumerator MoveToFishingPoint(GameObject man,List<Transform> path)
{
// 将路径点转换为 Vector3 数组
@ -129,6 +154,7 @@ public class landContorl : MonoBehaviour
pathPoints[i] = path[path.Count - 1 - i].position; // 从最后一个点开始赋值
}
man.transform.rotation = Quaternion.Euler(0, 0, 0); // 朝向右边
// 创建一个摆动效果的 Tween
@ -151,7 +177,13 @@ public class landContorl : MonoBehaviour
swayTween.Kill();
Debug.LogError("返航完成,开始:真·摸-鱼");
Debug.LogError("返航完成,开始:真·摸-鱼,加钱");
fishMan.GetComponent<shipcontorl>().SetState(ShipState.draw);
goldnumer += 1000;
}
void ChangeShipLook(Vector3 startpos,Vector3 endpos)
{
}
}