脚本相关
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 370fe07e6dd1446298721033a240b4fd
|
||||
timeCreated: 1756363974
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace NBF.Fishing2
|
||||
{
|
||||
protected override void Handler(NumericChange self)
|
||||
{
|
||||
if (self.Old == self.New) return;
|
||||
if (self.NumericType == NumericType.Flashlight)
|
||||
{
|
||||
var flashlight = self.MapUnit.GetComponent<FlashlightComponent>();
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace NBF.Fishing2
|
||||
{
|
||||
protected override async FTask Run(Session session, Map2C_RolePropertyChangeNotify message)
|
||||
{
|
||||
Log.Info($"收到角色属性推送 id={message.Id}");
|
||||
var map = App.Main.GetComponent<Map>();
|
||||
var unit = map.Units[message.Id];
|
||||
var numericComponent = unit.GetComponent<NumericComponent>();
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace NBF.Fishing2
|
||||
GameObject = gameObject;
|
||||
Transform = gameObject.transform;
|
||||
Asset = gameObject.GetComponent<PlayerAsset>();
|
||||
Parent.AddComponent<FlashlightComponent>();
|
||||
Parent.GetOrAddComponent<FlashlightComponent>();
|
||||
Parent.GetOrAddComponent<CharacterControllerComponent>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user