This commit is contained in:
CortexCore
2024-03-29 00:58:24 +08:00
parent 967ad8eacf
commit 05315ef4a8
232 changed files with 53368 additions and 8539 deletions

View File

@@ -4,7 +4,9 @@
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
"GUID:3e9ced9430d8ee743b37f99f97066130"
"GUID:3e9ced9430d8ee743b37f99f97066130",
"GUID:2b6752324f5c76d4cad13e2095c77b9e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using BITKit;
using UnityEngine;
using UnityEngine.Animations;
namespace BITFALL.HotFix
{
public class PlayerSocketComponent : MonoBehaviour
{
[SerializeReference,SubclassSelector] private IReference reference;
public string Reference => reference.Value;
public void SetParent(Transform parent)
{
transform.SetPositionAndRotation(parent.position,parent.rotation);
transform.SetParentConstraint(parent);
}
}
}

View File

@@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using BITFALL.Cosmetic;
using BITKit;
using BITKit.Entities;
using UnityEngine;
namespace BITFALL.HotFix
{
public class PlayerSocketService : EntityBehavior
{
[Inject(true)] private ICosmeticService _cosmeticService;
public override void OnAwake()
{
base.OnAwake();
_cosmeticService.OnCosmeticsChanged += OnCosmeticsChanged;
OnCosmeticsChanged();
}
public override void OnDestroyComponent()
{
base.OnDestroyComponent();
_cosmeticService.OnCosmeticsChanged -= OnCosmeticsChanged;
}
private void OnCosmeticsChanged()
{
var tags = GetComponentsInChildren<Tag>(true);
foreach (var socketComponent in GetComponentsInChildren<PlayerSocketComponent>())
{
var target = tags.FirstOrDefault(x => x.GetTags().Contains(socketComponent.Reference));
if (target is not null)
{
socketComponent.SetParent(target.transform);
}
}
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITFALL.HotFix
{
public class WorldCanvasCameraService : MonoBehaviour
{
[SerializeField] private Canvas canvas;
private void Update()
{
if (!canvas.worldCamera)
{
canvas.worldCamera = Camera.main;
}
}
}
}