using System; using System.Collections; using System.Collections.Generic; using System.Security; using BITFALL.Entities.Equipment; using BITKit; using BITKit.Entities; using BITKit.Entities.Player; using UnityEngine; using UnityEngine.InputSystem; namespace BITFALL.Editor { public class BITFALLDebuger : MonoBehaviour { [SerializeReference,SubclassSelector] private IPlayerService playerService; [SerializeField] private ScriptableItem forceItem; [SerializeReference, SubclassSelector] private IReference noclipEnv; private void Update() { if (Keyboard.current.numpad0Key.wasPressedThisFrame) { playerService.LocalPlayer.Get().HealthPoint = 100; } if (Keyboard.current.numpad1Key.wasPressedThisFrame) { playerService.LocalPlayer.Get().HealthPoint = -1; } if (Keyboard.current.numpad2Key.wasPressedThisFrame) { playerService.LocalPlayer.Invoke(new DamageMessage() { Target = playerService.LocalPlayer, Damage = 101, }); } if (Keyboard.current.numpadPlusKey.wasPressedThisFrame) { Time.timeScale = Mathf.Clamp(Time.timeScale + 0.2f, 0, 2); Debug.Log(Time.timeScale); } if (Keyboard.current.numpadMinusKey.wasPressedThisFrame) { Time.timeScale = Mathf.Clamp(Time.timeScale - 0.2f, 0, 2); Debug.Log(Time.timeScale); } if(Keyboard.current.slashKey.wasPressedThisFrame) { var noclip = Data.Get(noclipEnv.Value); Data.Set(noclipEnv.Value, !noclip); } if (Keyboard.current.numpad4Key.wasPressedThisFrame) { var equipment = playerService.LocalPlayer.GetComponent(); var index = equipment.FindIndex(x => x == forceItem.AddressablePath); if(index != -1) { equipment.SetEquipPriority(int.MaxValue, index); } } if (Keyboard.current.numpad5Key.wasPressedThisFrame) { var equipment = playerService.LocalPlayer.GetComponent(); equipment.RemoveEquipPriority(int.MaxValue); } } private void OnDestroy() { Time.timeScale = 1; } } }