首次提交
This commit is contained in:
46
Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs
generated
Normal file
46
Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs
generated
Normal file
@@ -0,0 +1,46 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
/// <summary> </summary>
|
||||
public partial class FishingPanel
|
||||
{
|
||||
public GObject this[string aKey] => ContentPane.GetChild(aKey);
|
||||
public override string UIPackName => "Fishing";
|
||||
public override string UIResName => "FishingPanel";
|
||||
|
||||
[AutoFind(Name = "throwCtrl")]
|
||||
public Controller throwCtrl;
|
||||
[AutoFind(Name = "fishingState")]
|
||||
public Controller fishingState;
|
||||
[AutoFind(Name = "driveType")]
|
||||
public Controller driveType;
|
||||
[AutoFind(Name = "ThrowProgress")]
|
||||
public GProgressBar ThrowProgress;
|
||||
[AutoFind(Name = "TextFPS")]
|
||||
public GTextField TextFPS;
|
||||
[AutoFind(Name = "TextTime")]
|
||||
public GLabel TextTime;
|
||||
[AutoFind(Name = "FishingState")]
|
||||
public FishingStateInfo FishingState;
|
||||
[AutoFind(Name = "Interactive")]
|
||||
public InteractiveTag Interactive;
|
||||
[AutoFind(Name = "OperationTips")]
|
||||
public GList OperationTips;
|
||||
[AutoFind(Name = "Team")]
|
||||
public FishingTeam Team;
|
||||
public override string[] GetDependPackages(){ return new string[] {"Common"}; }
|
||||
|
||||
public static void Show(object param = null){ UI.Inst.OpenUI<FishingPanel>(param); }
|
||||
|
||||
public static void Hide(){ UI.Inst.HideUI<FishingPanel>(); }
|
||||
|
||||
public static void Del(){ UI.Inst.DestroyUI<FishingPanel>(); }
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/FishingPanel.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93d7d712d91923540b1264791e706922
|
||||
77
Assets/Scripts/UI/Fishing/FishingPanel.cs
Normal file
77
Assets/Scripts/UI/Fishing/FishingPanel.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
|
||||
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class FishingPanel : UIPanel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
IsShowCursor = false;
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
InputManager.OnUICanceled += OnUICanceled;
|
||||
InputManager.OnInteractiveObjectAction += OnInteractiveObjectAction;
|
||||
InputManager.OnPlayerCanceled += OnPlayerCanceled;
|
||||
// InputManager.OnUseAction += OnUseAction;
|
||||
// InputManager.OnUse2Action += OnUse2Action;
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (!SceneSettings.Instance) return;
|
||||
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 OnUICanceled(string action)
|
||||
{
|
||||
if (action == InputDef.UI.Back)
|
||||
{
|
||||
if (!IsTop) return;
|
||||
// HomePanel.Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPlayerCanceled(string action)
|
||||
{
|
||||
if (Interactive.visible)
|
||||
{
|
||||
if (action == "Use1")
|
||||
{
|
||||
Interactive.Use1();
|
||||
}
|
||||
else if (action == "Use2")
|
||||
{
|
||||
Interactive.Use2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
base.OnHide();
|
||||
InputManager.OnUICanceled -= OnUICanceled;
|
||||
InputManager.OnInteractiveObjectAction -= OnInteractiveObjectAction;
|
||||
InputManager.OnUICanceled -= OnPlayerCanceled;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/FishingPanel.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/FishingPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23c91730a79197740aaf6825011a28a9
|
||||
25
Assets/Scripts/UI/Fishing/FishingPower.Designer.cs
generated
Normal file
25
Assets/Scripts/UI/Fishing/FishingPower.Designer.cs
generated
Normal 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 FishingPower
|
||||
{
|
||||
public const string URL = "ui://682kb9n0o0hz1n";
|
||||
|
||||
public GImage Bar;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
Bar = (GImage)GetChild("Bar");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/FishingPower.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/FishingPower.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d08e77978ab5a84ca7df443a33b7e7e
|
||||
15
Assets/Scripts/UI/Fishing/FishingPower.cs
Normal file
15
Assets/Scripts/UI/Fishing/FishingPower.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class FishingPower : GComponent
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/FishingPower.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/FishingPower.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47254356d93308a408f169217efa0272
|
||||
27
Assets/Scripts/UI/Fishing/FishingStateInfo.Designer.cs
generated
Normal file
27
Assets/Scripts/UI/Fishing/FishingStateInfo.Designer.cs
generated
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dde0fb0491131de41919399c219e6cd8
|
||||
15
Assets/Scripts/UI/Fishing/FishingStateInfo.cs
Normal file
15
Assets/Scripts/UI/Fishing/FishingStateInfo.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class FishingStateInfo : GLabel
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/FishingStateInfo.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/FishingStateInfo.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c0786297b4fc9843a13ad5b5260936d
|
||||
25
Assets/Scripts/UI/Fishing/InteractiveTag.Designer.cs
generated
Normal file
25
Assets/Scripts/UI/Fishing/InteractiveTag.Designer.cs
generated
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d866f9f28bbd2d46a69e9b1bd2e9fa8
|
||||
74
Assets/Scripts/UI/Fishing/InteractiveTag.cs
Normal file
74
Assets/Scripts/UI/Fishing/InteractiveTag.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
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;
|
||||
Debug.Log(_interactiveData.Use1);
|
||||
|
||||
if (_interactiveObject.Type == UIDef.InteractiveType.Boat)
|
||||
{
|
||||
//上船
|
||||
Debug.Log("上船===");
|
||||
// var boat = _interactiveObject.gameObject.GetComponent<Boat>();
|
||||
// Fishing.Inst.Player.SelfPlayer.EnterBoat(boat);
|
||||
// Fishing.Inst.Player
|
||||
}
|
||||
else if (_interactiveObject.Type == UIDef.InteractiveType.FishingShop)
|
||||
{
|
||||
FishingShopPanel.Show();
|
||||
}
|
||||
}
|
||||
|
||||
public void Use2()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_interactiveData.Use2)) return;
|
||||
Debug.Log(_interactiveData.Use2);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/InteractiveTag.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/InteractiveTag.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04d94697f36267345bce12ab05cbb3d2
|
||||
35
Assets/Scripts/UI/Fishing/WeatherInfo.Designer.cs
generated
Normal file
35
Assets/Scripts/UI/Fishing/WeatherInfo.Designer.cs
generated
Normal file
@@ -0,0 +1,35 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class WeatherInfo
|
||||
{
|
||||
public const string URL = "ui://682kb9n0tmu81h";
|
||||
|
||||
public GTextField TextTime;
|
||||
public GTextField TextTemperature;
|
||||
public GLoader IconWeather;
|
||||
public GLoader IconWind;
|
||||
public GTextField TextWindDir;
|
||||
public GTextField TextWind;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
TextTime = (GTextField)GetChild("TextTime");
|
||||
TextTemperature = (GTextField)GetChild("TextTemperature");
|
||||
IconWeather = (GLoader)GetChild("IconWeather");
|
||||
IconWind = (GLoader)GetChild("IconWind");
|
||||
TextWindDir = (GTextField)GetChild("TextWindDir");
|
||||
TextWind = (GTextField)GetChild("TextWind");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/WeatherInfo.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/WeatherInfo.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38ea73cd713fc09459c15a7c38ba7fee
|
||||
36
Assets/Scripts/UI/Fishing/WeatherInfo.cs
Normal file
36
Assets/Scripts/UI/Fishing/WeatherInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class WeatherInfo : GLabel
|
||||
{
|
||||
private int _count;
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
base.OnUpdate();
|
||||
UpdateWeather();
|
||||
}
|
||||
|
||||
private void UpdateWeather(bool force = false)
|
||||
{
|
||||
_count++;
|
||||
if (force)
|
||||
{
|
||||
_count = 30;
|
||||
}
|
||||
|
||||
if (_count < 30) return;
|
||||
_count = 0;
|
||||
TextTime.text = GameTimer.gameTimeString;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Fishing/WeatherInfo.cs.meta
Normal file
2
Assets/Scripts/UI/Fishing/WeatherInfo.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f135dbb504e701f49a23ea479eda9800
|
||||
Reference in New Issue
Block a user