This commit is contained in:
CortexCore
2023-09-01 14:35:05 +08:00
parent a71288cf2d
commit 5561f5c3cc
136 changed files with 69284 additions and 66121 deletions

View File

@@ -0,0 +1,21 @@
{
"name": "BITKit.Entities.Player.Camera",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
"GUID:a45ea9d98164db34f9c3c360d07b4ab2",
"GUID:f822dbf6fdfd4a5469cccaa2e4eed3b6",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:7efac18f239530141802fb139776f333"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 638f6e16b87ad5c4b8898803586edd2f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,3 +1,4 @@
using BITKit.Entities.Player;
using UnityEngine;
namespace BITKit.Entities
{
@@ -8,14 +9,10 @@ namespace BITKit.Entities
public Behaviour deathCamera;
[Header(Constant.Header.Reference)]
[SerializeReference, SubclassSelector] public IReference _onSetAlive;
public override void OnPlayerInitialized()
public override void OnAwake()
{
OnSetAlive(true);
}
public override void OnPlayerDispose()
{
aliveCamera.enabled = deathCamera.enabled = false;
var heal = entity.Get<IHealth>();
heal.OnSetAlive += OnSetAlive;
}
private void OnSetAlive(bool alive)
{