1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Animancer;
|
||||
using BITKit;
|
||||
using BITKit.Entities;
|
||||
using Cysharp.Threading.Tasks;
|
||||
@@ -19,6 +20,7 @@ namespace Net.Like.Xue.Tokyo
|
||||
|
||||
private readonly IPlayerFactory _playerFactory;
|
||||
private readonly IDialogueService _dialogueService;
|
||||
private readonly PlayerAutoHealController _healController;
|
||||
|
||||
private readonly ITicker _ticker;
|
||||
|
||||
@@ -32,22 +34,25 @@ namespace Net.Like.Xue.Tokyo
|
||||
{
|
||||
_playerFactory = playerFactory;
|
||||
_dialogueService = dialogueService;
|
||||
_healController = healController;
|
||||
_ticker = ticker;
|
||||
_entitiesService = entitiesService;
|
||||
_logger = logger;
|
||||
|
||||
_playerFactory.OnEntityCreated += OnEntityCreated;
|
||||
|
||||
_disabledHealth.AddListener(x =>
|
||||
{
|
||||
_logger.LogInformation(!x ? "开启回血" : "关闭回血");
|
||||
healController.Enabled = !x;
|
||||
});
|
||||
|
||||
_disabledHealth.AddListener(OnDisableHealth);
|
||||
|
||||
_disabledHealth.Invoke();
|
||||
|
||||
ticker.Add(OnTick);
|
||||
}
|
||||
|
||||
void OnDisableHealth(bool x)
|
||||
{
|
||||
_logger.LogInformation(!x ? "开启回血" : "关闭回血");
|
||||
_healController.Enabled = !x;
|
||||
}
|
||||
|
||||
private void OnTick(float obj)
|
||||
{
|
||||
|
Reference in New Issue
Block a user