完成交互逻辑

This commit is contained in:
2025-05-20 00:22:31 +08:00
parent 84d13e8981
commit b0abc1c30a
63 changed files with 42664 additions and 42166 deletions

View File

@@ -77,6 +77,15 @@
"interactions": "",
"initialStateCheck": false
},
{
"name": "Use2",
"type": "Button",
"id": "45a833e1-2aaf-4907-ae1e-1d97ee260b18",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "SelectItem",
"type": "Button",
@@ -319,15 +328,6 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "ReUse",
"type": "Button",
"id": "45a833e1-2aaf-4907-ae1e-1d97ee260b18",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
@@ -910,7 +910,7 @@
"interactions": "",
"processors": "",
"groups": "",
"action": "ReUse",
"action": "Use2",
"isComposite": false,
"isPartOfComposite": false
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7db84c72b2408b24da5a225550b562ff
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fe4970195facd664dbd38d1cbf2100c3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fe49412ddf5ce0b49970085d88a511ca
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: beb37a5cb31622342994b89488f039d3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -228747253, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: OdinModuleConfig
m_EditorClassIdentifier:
configurations:
- ID: Unity.Mathematics
ActivationSettings: 0
ModuleTogglingSettings: 1
ModuleUpdateSettings: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0a514d50c55b6f540babc121c64234b5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -1,117 +0,0 @@
fileFormatVersion: 2
guid: bb0f7bff6c6a078469fbc95331596bd3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
using System;
using UnityEngine;
namespace NBF
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
public class ShowIconAttribute : PropertyAttribute
{
public readonly string icon;
public ShowIconAttribute(string icon) => this.icon = icon;
}
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
public class OpCountAttribute : PropertyAttribute
{
public readonly int count;
public OpCountAttribute(int count) => this.count = count;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 772c563e061446c18c624311c27ba9a3
timeCreated: 1747666608

View File

@@ -1,8 +1,147 @@
namespace NBF
using System.Collections.Generic;
namespace NBF
{
public class InteractiveData
{
public UIDef.InteractiveType Type;
public string Icon = "op-door";
public string Name;
public string Use1;
public string Use2;
public string Use1Title = "进入";
public string Use2Title;
}
public class GameDef
{
public const int NormalFOV = 50;
public const int ZoomedFOV = 25;
public static List<InteractiveData> InteractiveDataList = new List<InteractiveData>()
{
new InteractiveData()
{
Type = UIDef.InteractiveType.Boat,
Name = "船",
Icon = "op-boat",
Use1 = "1,1",
Use1Title = "上船"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Bank,
Name = "银行",
Icon = "op-bank",
Use1 = "1,1",
Use1Title = "进入"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Canteen,
Name = "餐厅",
Icon = "op-door",
Use1 = "1,1",
Use1Title = "热饭"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Oven,
Name = "烤箱",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "使用"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Tent,
Name = "帐篷",
Icon = "op-tent",
Use1 = "1,1",
Use1Title = "打开"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Drying,
Name = "晾干器",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "使用"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Bonfire,
Name = "篝火",
Icon = "op-fire",
Use1 = "1,1",
Use1Title = "使用"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Fumigate,
Name = "烟熏箱",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "使用"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.FoodShop,
Name = "食品商店",
Icon = "op-door",
Use1 = "1,1",
Use2 = "1,1",
Use1Title = "进入",
Use2Title = "退货"
},
new InteractiveData()
{
Type = UIDef.InteractiveType.FishingShop,
Name = "钓鱼商店",
Icon = "op-door",
Use1 = "1,1",
Use1Title = "进入",
},
new InteractiveData()
{
Type = UIDef.InteractiveType.ToolsShop,
Name = "工业品店",
Icon = "op-door",
Use1 = "1,1",
Use1Title = "进入",
},
new InteractiveData()
{
Type = UIDef.InteractiveType.VendingMachine,
Name = "自动贩卖机",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "进入",
},
new InteractiveData()
{
Type = UIDef.InteractiveType.Wharf,
Name = "码头",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "进入",
},
new InteractiveData()
{
Type = UIDef.InteractiveType.FishBazaar,
Name = "鱼市",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "进入",
},
new InteractiveData()
{
Type = UIDef.InteractiveType.ReserveBazaar,
Name = "订购市场",
Icon = "op-use",
Use1 = "1,1",
Use1Title = "进入",
},
};
}
}

View File

@@ -1,4 +1,6 @@
namespace NBF
using UnityEngine;
namespace NBF
{
public class UIDef
{
@@ -50,5 +52,38 @@
/// </summary>
public const int Max = 3100;
}
public enum InteractiveType
{
[InspectorName("船")] Boat = 1,
[InspectorName("银行")] Bank = 2,
[InspectorName("餐厅")] Canteen = 3,
[InspectorName("烤箱")] Oven = 4,
[InspectorName("帐篷")] Tent = 5,
[InspectorName("晾干器")] Drying = 6,
[InspectorName("篝火")] Bonfire = 7,
[InspectorName("烟熏箱")] Fumigate = 8,
[InspectorName("食品商店")] FoodShop = 11,
[InspectorName("钓鱼商店")] FishingShop = 12,
[InspectorName("工业品店")] ToolsShop = 13,
[InspectorName("自动贩卖机")] VendingMachine = 14,
[InspectorName("码头")] Wharf = 15,
[InspectorName("鱼市")] FishBazaar = 21,
[InspectorName("订购市场")] ReserveBazaar = 22
}
}
}

View File

@@ -16,7 +16,8 @@ namespace NBF
public static event Action<bool> OnOp1Action;
public static event Action<bool> OnOp2Action;
public static event Action<bool> OnUseAction;
public static event Action OnUseAction;
public static event Action OnUse2Action;
public static event Action<bool> OnSelectItemAction;
public static event Action<bool> OnSelectBaitAction;
public static event Action<bool> OnSelectFoodAction;
@@ -148,6 +149,8 @@ namespace NBF
PlayerInputControl.Normal.Op2.canceled += OnOp2;
PlayerInputControl.Normal.Use.performed += OnUse;
PlayerInputControl.Normal.Use.canceled += OnUse;
PlayerInputControl.Normal.Use2.performed += OnUse2;
PlayerInputControl.Normal.Use2.canceled += OnUse2;
PlayerInputControl.Normal.SelectItem.performed += OnSelectItem;
PlayerInputControl.Normal.SelectItem.canceled += OnSelectItem;
@@ -221,6 +224,8 @@ namespace NBF
PlayerInputControl.Normal.Op2.canceled -= OnOp2;
PlayerInputControl.Normal.Use.performed -= OnUse;
PlayerInputControl.Normal.Use.canceled -= OnUse;
PlayerInputControl.Normal.Use2.performed -= OnUse2;
PlayerInputControl.Normal.Use2.canceled -= OnUse2;
PlayerInputControl.Normal.SelectItem.performed -= OnSelectItem;
PlayerInputControl.Normal.SelectItem.canceled -= OnSelectItem;
@@ -311,7 +316,18 @@ namespace NBF
private void OnUse(InputAction.CallbackContext context)
{
OnUseAction?.Invoke(context.performed);
if (context.performed)
{
OnUseAction?.Invoke();
}
}
private void OnUse2(InputAction.CallbackContext context)
{
if (context.performed)
{
OnUse2Action?.Invoke();
}
}
private void OnSelectItem(InputAction.CallbackContext context)

View File

@@ -1,8 +1,10 @@
using UnityEngine;
using System;
using UnityEngine;
namespace NBF
{
public class InteractiveObject : MonoBehaviour
{
[Header("交互类型")] public UIDef.InteractiveType Type;
}
}

View File

@@ -165,6 +165,15 @@ namespace NBF
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Use2"",
""type"": ""Button"",
""id"": ""45a833e1-2aaf-4907-ae1e-1d97ee260b18"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""SelectItem"",
""type"": ""Button"",
@@ -407,15 +416,6 @@ namespace NBF
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""ReUse"",
""type"": ""Button"",
""id"": ""45a833e1-2aaf-4907-ae1e-1d97ee260b18"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
@@ -998,7 +998,7 @@ namespace NBF
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""ReUse"",
""action"": ""Use2"",
""isComposite"": false,
""isPartOfComposite"": false
}
@@ -1106,6 +1106,7 @@ namespace NBF
m_Normal_Op1 = m_Normal.FindAction("Op1", throwIfNotFound: true);
m_Normal_Op2 = m_Normal.FindAction("Op2", throwIfNotFound: true);
m_Normal_Use = m_Normal.FindAction("Use", throwIfNotFound: true);
m_Normal_Use2 = m_Normal.FindAction("Use2", throwIfNotFound: true);
m_Normal_SelectItem = m_Normal.FindAction("SelectItem", throwIfNotFound: true);
m_Normal_SelectBait = m_Normal.FindAction("SelectBait", throwIfNotFound: true);
m_Normal_SelectFood = m_Normal.FindAction("SelectFood", throwIfNotFound: true);
@@ -1133,7 +1134,6 @@ namespace NBF
m_Normal_Quick8 = m_Normal.FindAction("Quick8", throwIfNotFound: true);
m_Normal_Quick9 = m_Normal.FindAction("Quick9", throwIfNotFound: true);
m_Normal_Back = m_Normal.FindAction("Back", throwIfNotFound: true);
m_Normal_ReUse = m_Normal.FindAction("ReUse", throwIfNotFound: true);
// UI
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
m_UI_Roll = m_UI.FindAction("Roll", throwIfNotFound: true);
@@ -1226,6 +1226,7 @@ namespace NBF
private readonly InputAction m_Normal_Op1;
private readonly InputAction m_Normal_Op2;
private readonly InputAction m_Normal_Use;
private readonly InputAction m_Normal_Use2;
private readonly InputAction m_Normal_SelectItem;
private readonly InputAction m_Normal_SelectBait;
private readonly InputAction m_Normal_SelectFood;
@@ -1253,7 +1254,6 @@ namespace NBF
private readonly InputAction m_Normal_Quick8;
private readonly InputAction m_Normal_Quick9;
private readonly InputAction m_Normal_Back;
private readonly InputAction m_Normal_ReUse;
/// <summary>
/// Provides access to input actions defined in input action map "Normal".
/// </summary>
@@ -1298,6 +1298,10 @@ namespace NBF
/// </summary>
public InputAction @Use => m_Wrapper.m_Normal_Use;
/// <summary>
/// Provides access to the underlying input action "Normal/Use2".
/// </summary>
public InputAction @Use2 => m_Wrapper.m_Normal_Use2;
/// <summary>
/// Provides access to the underlying input action "Normal/SelectItem".
/// </summary>
public InputAction @SelectItem => m_Wrapper.m_Normal_SelectItem;
@@ -1406,10 +1410,6 @@ namespace NBF
/// </summary>
public InputAction @Back => m_Wrapper.m_Normal_Back;
/// <summary>
/// Provides access to the underlying input action "Normal/ReUse".
/// </summary>
public InputAction @ReUse => m_Wrapper.m_Normal_ReUse;
/// <summary>
/// Provides access to the underlying input action map instance.
/// </summary>
public InputActionMap Get() { return m_Wrapper.m_Normal; }
@@ -1459,6 +1459,9 @@ namespace NBF
@Use.started += instance.OnUse;
@Use.performed += instance.OnUse;
@Use.canceled += instance.OnUse;
@Use2.started += instance.OnUse2;
@Use2.performed += instance.OnUse2;
@Use2.canceled += instance.OnUse2;
@SelectItem.started += instance.OnSelectItem;
@SelectItem.performed += instance.OnSelectItem;
@SelectItem.canceled += instance.OnSelectItem;
@@ -1540,9 +1543,6 @@ namespace NBF
@Back.started += instance.OnBack;
@Back.performed += instance.OnBack;
@Back.canceled += instance.OnBack;
@ReUse.started += instance.OnReUse;
@ReUse.performed += instance.OnReUse;
@ReUse.canceled += instance.OnReUse;
}
/// <summary>
@@ -1578,6 +1578,9 @@ namespace NBF
@Use.started -= instance.OnUse;
@Use.performed -= instance.OnUse;
@Use.canceled -= instance.OnUse;
@Use2.started -= instance.OnUse2;
@Use2.performed -= instance.OnUse2;
@Use2.canceled -= instance.OnUse2;
@SelectItem.started -= instance.OnSelectItem;
@SelectItem.performed -= instance.OnSelectItem;
@SelectItem.canceled -= instance.OnSelectItem;
@@ -1659,9 +1662,6 @@ namespace NBF
@Back.started -= instance.OnBack;
@Back.performed -= instance.OnBack;
@Back.canceled -= instance.OnBack;
@ReUse.started -= instance.OnReUse;
@ReUse.performed -= instance.OnReUse;
@ReUse.canceled -= instance.OnReUse;
}
/// <summary>
@@ -1920,6 +1920,13 @@ namespace NBF
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnUse(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Use2" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnUse2(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "SelectItem" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
@@ -2108,13 +2115,6 @@ namespace NBF
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnBack(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "ReUse" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnReUse(InputAction.CallbackContext context);
}
/// <summary>
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "UI" which allows adding and removing callbacks.

View File

@@ -8,6 +8,8 @@ namespace NBF
{
public static void BindAll()
{
UIObjectFactory.SetPackageItemExtension(FishingStateInfo.URL, typeof(FishingStateInfo));
UIObjectFactory.SetPackageItemExtension(InteractiveTag.URL, typeof(InteractiveTag));
UIObjectFactory.SetPackageItemExtension(FishingPower.URL, typeof(FishingPower));
UIObjectFactory.SetPackageItemExtension(WeatherInfo.URL, typeof(WeatherInfo));
}

View File

@@ -13,12 +13,18 @@ namespace NBF
public GObject this[string aKey] => ContentPane.GetChild(aKey);
[AutoFind(Name = "throwCtrl")]
public Controller throwCtrl;
[AutoFind(Name = "fishingState")]
public Controller fishingState;
[AutoFind(Name = "ThrowProgress")]
public GProgressBar ThrowProgress;
[AutoFind(Name = "TextFPS")]
public GTextField TextFPS;
[AutoFind(Name = "TextTime")]
public WeatherInfo TextTime;
[AutoFind(Name = "FishingState")]
public FishingStateInfo FishingState;
[AutoFind(Name = "Interactive")]
public InteractiveTag Interactive;
public override string[] GetDependPackages(){ return new string[] {}; }

View File

@@ -11,14 +11,12 @@ namespace NBF
public override string UIPackName => "Fishing";
public override string UIResName => "FishingPanel";
protected override void OnInit()
{
base.OnInit();
}
protected override void OnShow()
{
base.OnShow();
InputManager.OnInteractiveObjectAction += OnInteractiveObjectAction;
InputManager.OnUseAction += OnUseAction;
InputManager.OnUse2Action += OnUse2Action;
}
protected override void OnUpdate()
@@ -27,14 +25,41 @@ namespace NBF
TextFPS.text = SceneSettings.Instance.FPS.ToString(CultureInfo.InvariantCulture);
}
private void OnInteractiveObjectAction(InteractiveObject interactiveObject)
{
if (interactiveObject != null)
{
Interactive.visible = true;
Interactive.SetData(interactiveObject);
}
else
{
Interactive.visible = false;
}
}
private void OnUseAction()
{
if (Interactive.visible)
{
Interactive.Use1();
}
}
private void OnUse2Action()
{
if (Interactive.visible)
{
Interactive.Use2();
}
}
protected override void OnHide()
{
base.OnHide();
}
protected override void OnDestroy()
{
base.OnDestroy();
InputManager.OnInteractiveObjectAction -= OnInteractiveObjectAction;
InputManager.OnUseAction -= OnUseAction;
InputManager.OnUse2Action -= OnUse2Action;
}
}
}

View File

@@ -0,0 +1,25 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class InteractiveTag
{
public const string URL = "ui://682kb9n0fcfg1p";
public GList List;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
List = (GList)GetChild("List");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0d866f9f28bbd2d46a69e9b1bd2e9fa8

View File

@@ -0,0 +1,58 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using FairyGUI;
namespace NBF
{
public partial class InteractiveTag : GLabel
{
private InteractiveObject _interactiveObject;
private InteractiveData _interactiveData;
private void OnInited()
{
}
public void SetData(InteractiveObject interactiveObject)
{
_interactiveObject = interactiveObject;
List.RemoveChildrenToPool();
var interactiveType = GameDef.InteractiveDataList.Find(t => t.Type == interactiveObject.Type);
if (interactiveType != null)
{
_interactiveData = interactiveType;
if (!string.IsNullOrEmpty(interactiveType.Use1))
{
var item1 = List.AddItemFromPool().asLabel;
item1.title = "E - " + interactiveType.Use1Title;
}
if (!string.IsNullOrEmpty(interactiveType.Use2))
{
var item2 = List.AddItemFromPool().asLabel;
item2.title = "Y - " + interactiveType.Use2Title;
}
var iconUrl = UIPackage.GetItemURL("Common", interactiveType.Icon);
icon = iconUrl;
title = interactiveType.Name;
}
}
public void Use1()
{
if (string.IsNullOrEmpty(_interactiveData.Use1)) return;
}
public void Use2()
{
if (string.IsNullOrEmpty(_interactiveData.Use2)) return;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 04d94697f36267345bce12ab05cbb3d2

View File

@@ -0,0 +1,27 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class FishingStateInfo
{
public const string URL = "ui://682kb9n0fcfg1o";
public FishingPower Power;
public GTextField TextTitle;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
Power = (FishingPower)GetChild("Power");
TextTitle = (GTextField)GetChild("TextTitle");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dde0fb0491131de41919399c219e6cd8

View File

@@ -0,0 +1,15 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class FishingStateInfo : GLabel
{
private void OnInited()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0c0786297b4fc9843a13ad5b5260936d

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="120,26" extention="Label">
<displayList>
<text id="n12_tmu8" name="title" xy="0,0" size="120,26" fontSize="17" color="#ffffff" align="center" autoSize="ellipsis" text="title">
<relation target="" sidePair="width-width,height-height"/>
</text>
</displayList>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -47,6 +47,27 @@
<image id="cvcwfe" name="Square_1.png" path="/Images/Shapes/Square/" exported="true" scale="9grid" scale9grid="1,1,2,2"/>
<image id="jgrjff" name="Loading_2.png" path="/Images/" exported="true"/>
<image id="jgrjfg" name="Loading_1.png" path="/Images/" exported="true"/>
<image id="tmu81f" name="暴雨.png" path="/Icon/天气/" exported="true"/>
<image id="tmu819" name="大风.png" path="/Icon/天气/" exported="true"/>
<image id="tmu81c" name="大雾白天.png" path="/Icon/天气/" exported="true"/>
<image id="tmu815" name="大雪.png" path="/Icon/天气/" exported="true"/>
<image id="tmu81e" name="大雨.png" path="/Icon/天气/" exported="true"/>
<image id="tmu81b" name="多云白天.png" path="/Icon/天气/" exported="true"/>
<image id="tmu818" name="风力.png" path="/Icon/天气/" exported="true"/>
<image id="tmu816" name="雷暴.png" path="/Icon/天气/" exported="true"/>
<image id="tmu81a" name="晴天白天.png" path="/Icon/天气/" exported="true"/>
<image id="tmu817" name="微风.png" path="/Icon/天气/" exported="true"/>
<image id="tmu81g" name="阵雨.png" path="/Icon/天气/" exported="true"/>
<image id="tmu814" name="中雪.png" path="/Icon/天气/" exported="true"/>
<image id="tmu81d" name="中雨.png" path="/Icon/天气/" exported="true"/>
<image id="fcfgfh" name="op-use.png" path="/Icon/交互/" exported="true"/>
<image id="fcfgfi" name="op-fire.png" path="/Icon/交互/" exported="true"/>
<image id="fcfgfj" name="op-tent.png" path="/Icon/交互/" exported="true"/>
<image id="fcfgfk" name="op-door.png" path="/Icon/交互/" exported="true"/>
<image id="fcfgfl" name="op-boat.png" path="/Icon/交互/" exported="true"/>
<component id="tmu81k" name="TextTag.xml" path="/Com/" exported="true"/>
<component id="fcfgfm" name="TextCenterTag.xml" path="/Com/" exported="true"/>
<image id="fcfgfn" name="op-bank.png" path="/Icon/交互/" exported="true"/>
</resources>
<publish name="" path="../Assets/Resources/Fgui/Common" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="850,74" extention="Label" designImage="ui://682kb9n0tmu81i" designImageOffsetX="-536" designImageOffsetY="-1019" designImageAlpha="10">
<displayList>
<component id="n26_o0hz" name="Power" src="o0hz1n" fileName="Com/FishingPower.xml" xy="0,45">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
<text id="n27_o0hz" name="TextTitle" xy="0,18" size="138,25" fontSize="17" color="#ffffff" text="准备好,可以抛竿">
<relation target="n26_o0hz" sidePair="left-left,top-top"/>
</text>
</displayList>
</component>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="80,115" extention="Label">
<displayList>
<image id="n30_fcfg" name="n30" src="o0hzeq" fileName="Images/Shapes/Circle/Circle - 256.png" pkg="6hgkvlau" xy="0,0" size="80,80" alpha="0.3"/>
<image id="n32_fcfg" name="n32" src="o0hzex" fileName="Images/Shapes/Rounded/Rounded - Stroke 8px.png" pkg="6hgkvlau" xy="0,0" size="80,80"/>
<loader id="n35_fcfg" name="icon" xy="10,10" size="60,60" url="ui://6hgkvlaufcfgfk" align="center" vAlign="middle" fill="scale"/>
<text id="n37_fcfg" name="title" xy="8,82" pivot="0.5,0.5" size="63,29" font="ui://6hgkvlaugkm7w" fontSize="20" color="#ffffff" align="center" vAlign="middle" text="取款机"/>
<list id="n38_fcfg" name="List" xy="-57,118" size="200,107" touchable="false" overflow="scroll" defaultItem="ui://6hgkvlaufcfgfm" align="center">
<item title="E - 进入"/>
<item title="Y - 退货"/>
</list>
</displayList>
</component>

View File

@@ -3,9 +3,9 @@
<displayList>
<text id="n7_tmu8" name="TextTime" xy="19,113" pivot="1,0" size="67,33" font="ui://6hgkvlaugkm7w" fontSize="23" color="#ffffff" align="right" text="07:24"/>
<text id="n8_tmu8" name="TextTemperature" xy="95,113" size="61,33" font="ui://6hgkvlaugkm7w" fontSize="23" color="#ffffff" text="12.7°"/>
<loader id="n11_tmu8" name="IconWeather" xy="45,17" size="90,90" url="ui://682kb9n0tmu81a" align="center" vAlign="middle" fill="scale"/>
<loader id="n11_tmu8" name="IconWeather" xy="45,17" size="90,90" url="ui://6hgkvlautmu81a" align="center" vAlign="middle" fill="scale"/>
<graph id="n12_tmu8" name="n12" xy="90,114" size="1,30" type="rect" lineSize="0"/>
<loader id="n13_tmu8" name="IconWind" xy="37,147" size="22,22" group="n16_tmu8" url="ui://682kb9n0tmu818" align="center" vAlign="middle" fill="scale"/>
<loader id="n13_tmu8" name="IconWind" xy="37,147" size="22,22" group="n16_tmu8" url="ui://6hgkvlautmu818" align="center" vAlign="middle" fill="scale"/>
<text id="n14_tmu8" name="TextWindDir" xy="60,146" size="22,24" group="n16_tmu8" fontSize="16" color="#ffffff" text="SE"/>
<text id="n15_tmu8" name="TextWind" xy="83,146" size="61,24" group="n16_tmu8" fontSize="16" color="#ffffff" text="2米每秒"/>
<group id="n16_tmu8" name="n16" xy="37,146" size="107,24" advanced="true" layout="hz" colGap="1" excludeInvisibles="true"/>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080" designImage="ui://682kb9n0tmu81i" designImageAlpha="100">
<component size="1920,1080" designImage="ui://682kb9n0tmu81i" designImageAlpha="5">
<controller name="throwCtrl" pages="0,,1,show" selected="0"/>
<controller name="fishingState" alias="状态" pages="0,默认,1,抛竿中,2,钓鱼中" selected="0"/>
<displayList>
<component id="n2_8b5t" name="ThrowProgress" src="8b5t0" fileName="Com/ThrowProgressBar.xml" xy="670,969" size="580,30">
<gearDisplay controller="throwCtrl" pages="1"/>
@@ -13,7 +14,7 @@
<component id="n7_tmu8" name="TextTime" src="tmu81h" fileName="Com/WeatherInfo.xml" xy="1739,0">
<relation target="" sidePair="right-right,top-top"/>
</component>
<list id="n13_tmu8" name="n13" xy="106,16" size="128,81" overflow="scroll" defaultItem="ui://682kb9n0tmu81k">
<list id="n13_tmu8" name="n13" xy="106,16" size="128,81" overflow="scroll" defaultItem="ui://6hgkvlautmu81k">
<item title="控制面板 - Esc"/>
<item title="帮助 - F1"/>
<item title="聊天 - Q"/>
@@ -21,9 +22,11 @@
<component id="n15_tmu8" name="n15" src="tmu81l" fileName="Com/HudItem.xml" xy="16,16">
<Button icon="ui://682kb9n0tmu81c"/>
</component>
<component id="n26_o0hz" name="n26" src="o0hz1n" fileName="Com/FishingPower.xml" xy="534,1047">
<component id="n26_o0hz" name="FishingState" src="fcfg1o" fileName="Com/FishingStateInfo.xml" xy="534,1000">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
<text id="n27_o0hz" name="n27" xy="534,1018" size="171,25" fontSize="17" color="#ffffff" text="钓具准备好,可以抛竿"/>
<component id="n29_fcfg" name="Interactive" src="fcfg1p" fileName="Com/InteractiveTag.xml" xy="920,482" visible="false">
<relation target="" sidePair="center-center,middle-middle"/>
</component>
</displayList>
</component>

View File

@@ -10,25 +10,13 @@
<component id="jgpto" name="Progress.xml" path="/Com/"/>
<component id="jgptp" name="PlayerInfo1.xml" path="/Com/"/>
<component id="tmu8q" name="SightTag.xml" path="/"/>
<image id="tmu814" name="中雪.png" path="/images/" exported="true"/>
<image id="tmu815" name="大雪.png" path="/images/" exported="true"/>
<image id="tmu816" name="雷暴.png" path="/images/" exported="true"/>
<image id="tmu817" name="微风.png" path="/images/" exported="true"/>
<image id="tmu818" name="风力.png" path="/images/" exported="true"/>
<image id="tmu819" name="大风.png" path="/images/" exported="true"/>
<image id="tmu81a" name="晴天白天.png" path="/images/" exported="true"/>
<image id="tmu81b" name="多云白天.png" path="/images/" exported="true"/>
<image id="tmu81c" name="大雾白天.png" path="/images/" exported="true"/>
<image id="tmu81d" name="中雨.png" path="/images/" exported="true"/>
<image id="tmu81e" name="大雨.png" path="/images/" exported="true"/>
<image id="tmu81f" name="暴雨.png" path="/images/" exported="true"/>
<image id="tmu81g" name="阵雨.png" path="/images/" exported="true"/>
<component id="tmu81h" name="WeatherInfo.xml" path="/Com/"/>
<image id="tmu81i" name="766570_19.jpg" path="/参考/"/>
<component id="tmu81k" name="TextTag.xml" path="/Com/"/>
<component id="tmu81l" name="HudItem.xml" path="/Com/"/>
<component id="o0hz1m" name="Component1.xml" path="/Com/"/>
<component id="o0hz1n" name="FishingPower.xml" path="/Com/"/>
<component id="fcfg1o" name="FishingStateInfo.xml" path="/Com/"/>
<component id="fcfg1p" name="InteractiveTag.xml" path="/Com/" exported="true"/>
</resources>
<publish name="" path="../Assets/Resources/Fgui/Fishing" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -0,0 +1 @@
{"url":"ui://682kb9n0fcfg1o","name":"FishingStateInfo","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -0,0 +1 @@
{"url":"ui://682kb9n0fcfg1p","name":"InteractiveTag","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIconAttribute_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003F6a_003F44c4467c_003FIconAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIMGUIContainer_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb4f75f0eb2d14004826911645c6175d61fbe00_003F49_003F22dd7281_003FIMGUIContainer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKeyCode_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd1_003F01a95d3a_003FKeyCode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARenderChain_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb4f75f0eb2d14004826911645c6175d61fbe00_003Fde_003Fedac53d9_003FRenderChain_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

View File

@@ -829,7 +829,7 @@ PlayerSettings:
QNX: TextMeshPro;UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI;ENVIRO_3;ENVIRO_URP
ReservedCFE: TextMeshPro;ENVIRO_3;ENVIRO_URP
Server: UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI
Standalone: OBI_ONI_SUPPORTED;TextMeshPro;UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI;STEAMWORKS_NET;ENVIRO_3;ENVIRO_URP;VLB_URP
Standalone: OBI_ONI_SUPPORTED;TextMeshPro;UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI;STEAMWORKS_NET;ENVIRO_3;ENVIRO_URP;VLB_URP;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3
VisionOS: TextMeshPro;UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI;ENVIRO_3;ENVIRO_URP
WebGL: TextMeshPro;UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI;ENVIRO_3;ENVIRO_URP
Windows Store Apps: UNITY_VISUAL_SCRIPTING;ES3_TMPRO;ES3_UGUI

View File

@@ -9,34 +9,34 @@ EditorUserSettings:
value: 18134705175a055722080a3115371d4a0d55006876786860616b0471b8b07a68ffab74f9ee2a3a30300cea1a11320d0beb1a0c25f7060f494b4cc80018eb09361fc211cb1f862d19c51d19dcc413d6ade0d8ddfcddf9f4d9d29195fcfde6ebeae6f0a9c9afa6f8c5b89ff7a1aacececac4eba4d7c9d28bda
flags: 0
RecentlyUsedSceneGuid-0:
value: 0150055704510808545c0a26467506444516197a747874637b7e1860b5b6616c
flags: 0
RecentlyUsedSceneGuid-1:
value: 0705515f0650505f5457092744210e4440154a2c792c2434752f1862b6e6353e
flags: 0
RecentlyUsedSceneGuid-2:
value: 5301070356065d0e5c0d5c73417759151016417a7b2d243275791e37e6b06160
flags: 0
RecentlyUsedSceneGuid-3:
RecentlyUsedSceneGuid-1:
value: 5305560255545f5f5f5d5d74427306444e154e2f7d2e7e66797b4862b4e3663c
flags: 0
RecentlyUsedSceneGuid-4:
RecentlyUsedSceneGuid-2:
value: 52530c5601535f020f565a2043770d1612154d2f747975692c7b4e66b5e3303b
flags: 0
RecentlyUsedSceneGuid-5:
RecentlyUsedSceneGuid-3:
value: 0709525704545b5d09590a2346775b46144f402b7e7a72632c7d4860e7e4353e
flags: 0
RecentlyUsedSceneGuid-6:
RecentlyUsedSceneGuid-4:
value: 5b520400060d5a5a5b5b557641770b43424f1c28787d25612b2d196ab0b66068
flags: 0
RecentlyUsedSceneGuid-7:
RecentlyUsedSceneGuid-5:
value: 5b08565357035d0c0f5d0a774277071242154029757170697b784e66e6b33060
flags: 0
RecentlyUsedSceneGuid-6:
value: 0657525703505b030b5f5d2141255e4445164c7a7d71716475284f6bb6e33668
flags: 0
RecentlyUsedSceneGuid-7:
value: 51090c5503010d5d5f0b0e26427a0b444215402f287e7f327b2c1f30e6b8303c
flags: 0
RecentlyUsedSceneGuid-8:
value: 5505015f5c515a085f5b092149760f441716407a787d7564287b1b36e7e1366e
value: 020056535456585e0f0d0a7541210d441215482c2d297f36752c1b65b3b0376e
flags: 0
RecentlyUsedSceneGuid-9:
value: 020056535456585e0f0d0a7541210d441215482c2d297f36752c1b65b3b0376e
value: 5505015f5c515a085f5b092149760f441716407a787d7564287b1b36e7e1366e
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650