This commit is contained in:
CortexCore
2023-10-04 16:50:27 +08:00
parent 947e52e748
commit 5cd094ed9a
263 changed files with 144068 additions and 66 deletions

View File

@@ -167,6 +167,7 @@ MonoBehaviour:
m_Bits: 3073
allowStatic: 0
useRigidbody: 0
immediately: 0
onDetected:
m_PersistentCalls:
m_Calls: []
@@ -221,6 +222,65 @@ Rigidbody:
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1 &2287839118949934139
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5719632646292846577}
- component: {fileID: 8053545106168593342}
m_Layer: 0
m_Name: Pick Rigidbody
m_TagString: Untagged
m_Icon: {fileID: 2800000, guid: eec067016ed060240b51e36c364fe955, type: 3}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5719632646292846577
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2287839118949934139}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2648601869858448235}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!54 &8053545106168593342
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2287839118949934139}
serializedVersion: 4
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1 &2316171592450128199
GameObject:
m_ObjectHideFlags: 0
@@ -1419,7 +1479,7 @@ MonoBehaviour:
applyWeightToGround: 1
applyWeightLayerMask:
serializedVersion: 2
m_Bits: 256
m_Bits: 257
weightGravity: 9.8
--- !u!114 &4784073750897180643
MonoBehaviour:
@@ -1862,9 +1922,9 @@ GameObject:
- component: {fileID: 2648601869858448235}
- component: {fileID: 4486952052422082421}
m_Layer: 0
m_Name: OverrideFPV
m_Name: CameraView
m_TagString: Untagged
m_Icon: {fileID: 0}
m_Icon: {fileID: 5132851093641282708, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
@@ -1883,6 +1943,7 @@ Transform:
m_Children:
- {fileID: 4757170763641365326}
- {fileID: 2019605867538852436}
- {fileID: 5719632646292846577}
m_Father: {fileID: 4826102346843731735}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4486952052422082421

View File

@@ -70,8 +70,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2000767763551424298}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.000000059604645, y: 0.9000001, z: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.8999999, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -182,8 +182,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2551180606990033913}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.00000011920929, y: 1.2999988, z: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.2999989, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -294,8 +294,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2817772008418802562}
serializedVersion: 2
m_LocalRotation: {x: 1, y: -0.00000009362675, z: -0, w: 0}
m_LocalPosition: {x: 0.099999905, y: 0.6, z: 0}
m_LocalRotation: {x: -0.99999934, y: -0, z: 0, w: -0.0011683682}
m_LocalPosition: {x: 0.099999905, y: 0.5999997, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -406,8 +406,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3358785089503055921}
serializedVersion: 2
m_LocalRotation: {x: 1, y: -0, z: -0, w: 0}
m_LocalPosition: {x: -0.099999905, y: 0.30000016, z: 0}
m_LocalRotation: {x: -0.9999992, y: 0, z: 0, w: 0.0012931724}
m_LocalPosition: {x: -0.099999905, y: 0.3000007, z: 0.00077581406}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -518,8 +518,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4373715169958296559}
serializedVersion: 2
m_LocalRotation: {x: -0.7071068, y: -0.70710677, z: -0.00000013240822, w: 0.00000013240823}
m_LocalPosition: {x: 0.2999996, y: 1.0999988, z: 0}
m_LocalRotation: {x: -0.5000898, y: -0.4999102, z: -0.4999102, w: 0.5000898}
m_LocalPosition: {x: 0.2999997, y: 1.0999988, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -630,8 +630,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4814532438191238496}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.000000059604645, y: 0.59999996, z: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.5999999, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -742,8 +742,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4847830526722242972}
serializedVersion: 2
m_LocalRotation: {x: 1, y: -0, z: -0, w: 0}
m_LocalPosition: {x: 0.099999785, y: 0.30000016, z: 0}
m_LocalRotation: {x: -0.99999934, y: -0.0000002808801, z: -3.281452e-10, w: 0.0011682743}
m_LocalPosition: {x: 0.099999905, y: 0.3000005, z: 0.0007009506}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -854,8 +854,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6838856782095480610}
serializedVersion: 2
m_LocalRotation: {x: 1, y: 0.00000009362675, z: 0.00000009362675, w: 8.7659685e-15}
m_LocalPosition: {x: -0.099999964, y: 0.6, z: 0}
m_LocalRotation: {x: 0.9999992, y: -3.6322662e-10, z: 0.00000028088004, w: 0.0012931724}
m_LocalPosition: {x: -0.099999905, y: 0.5999997, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -966,8 +966,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7405854416764959154}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: -0.7071068, z: -0.00000013240823, w: -0.00000013240823}
m_LocalPosition: {x: -0.29999977, y: 1.0999987, z: 0}
m_LocalRotation: {x: -0.5000006, y: 0.4999994, z: 0.4999994, w: 0.5000006}
m_LocalPosition: {x: -0.2999997, y: 1.0999986, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -1078,8 +1078,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7591505052710699887}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: -0.7071068, z: -0.00000013240823, w: -0.00000013240823}
m_LocalPosition: {x: -0.29999977, y: 1.0999987, z: 0}
m_LocalRotation: {x: -0.5000005, y: 0.49999955, z: 0.49999955, w: 0.5000005}
m_LocalPosition: {x: -0.49999958, y: 1.0999987, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -1190,8 +1190,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8909630876078933330}
serializedVersion: 2
m_LocalRotation: {x: -0.7071068, y: -0.70710677, z: -0.00000013240822, w: 0.00000013240823}
m_LocalPosition: {x: 0.2999996, y: 1.0999988, z: 0}
m_LocalRotation: {x: -0.5000896, y: -0.49991038, z: -0.49991038, w: 0.5000896}
m_LocalPosition: {x: 0.49999952, y: 1.0999992, z: -0.000071525574}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
using System;
using System.Linq;
using BITFALL.Guns.States;
using BITFALL.Player.Movement;
@@ -118,8 +119,16 @@ namespace BITFALL.Guns
_playerMovement = entity.Get<IPlayerMovement>();
_movement.OnStateChanged += OnMovementStateChanged;
_movement.OnCommand += OnMovementCommand;
}
private void OnDestroy()
{
actionGroup.UnRegisterCallback(fireAction, OnFire);
actionGroup.UnRegisterCallback(aimAction, OnAim);
actionGroup.UnRegisterCallback(reloadAction, OnReload);
actionGroup.UnRegisterCallback(meleeAction, OnMelee);
}
private void OnMovementCommand(object obj)
{
switch (obj)

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lightbug.CharacterControllerPro.Core;
using UnityEngine;
namespace BITFALL.Entities.Player.Movement
{
public class GravityOnlyCharacterController : MonoBehaviour
{
[SerializeField] private CharacterActor actor;
private void FixedUpdate()
{
actor.Velocity = Physics.gravity;
}
}
}

View File

@@ -60,6 +60,14 @@ namespace BITFALL.Entities.Player.Movement
physics.OnSetPhysics += OnSetPhysics;
}
public override void OnStart()
{
foreach (var x in GetComponentsInChildren<Collider>(true))
{
actor.PhysicsComponent.IgnoreCollision(x.transform,true);
}
}
private void OnSetPhysics(bool obj)
{
if (obj is false) return;

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITKit;
using Lightbug.Utilities;
using UnityEngine;
#if UNITY_EDITOR
@@ -15,20 +16,15 @@ namespace BITFALL.Scenes
[SerializeField] private float mass;
[SerializeField] private Animator animator;
[SerializeField] private RigidbodyComponent rigidbodyComponent;
private Vector3 currentPosition;
private Quaternion currentRotation;
private readonly DoubleBuffer<Vector3> currentPosition=new();
private readonly DoubleBuffer<Quaternion> currentRotation=new();
private void Start()
{
#if UNITY_EDITOR
if(EditorApplication.isPlaying is false)
return;
#endif
rigidbodyComponent = gameObject.AddComponent<RigidbodyComponent3D>();
var transform1 = transform;
currentPosition = transform1.position;
currentRotation=transform1.rotation;
rigidbodyComponent.UseGravity = false;
rigidbodyComponent.Mass = mass;
rigidbodyComponent = RigidbodyComponent.CreateInstance(gameObject);
}
private void FixedUpdate()
{
@@ -36,15 +32,16 @@ namespace BITFALL.Scenes
if(EditorApplication.isPlaying is false)
return;
#endif
rigidbodyComponent.Velocity = animator.velocity;
rigidbodyComponent.AngularVelocity = animator.angularVelocity;
rigidbodyComponent.MoveAndRotate(currentPosition,currentRotation);
if(currentPosition.TryGetRelease(out var position))
rigidbodyComponent.Position = position;
if(currentRotation.TryGetRelease(out var rotation))
rigidbodyComponent.Rotation = rotation;
}
private void OnAnimatorMove()
{
animator.ApplyBuiltinRootMotion();
currentPosition = animator.rootPosition;
currentRotation = animator.rootRotation;
animator.ApplyBuiltinRootMotion();
currentPosition.Release(animator.rootPosition);
currentRotation.Release(animator.rootRotation);
}
}

View File

@@ -13,6 +13,18 @@ MonoBehaviour:
m_Name: DialogueClip(Clone)(Clone)
m_EditorClassIdentifier:
subtitle: "\u7EC8\u6781\u4E00\u53F7,\u6211\u4EEC\u5230\u4E86,\u6211\u4EEC\u7B49\u4E0D\u4E86\u592A\u4E45"
--- !u!114 &-7003756086648336395
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3}
m_Name: ActivationPlayableAsset
m_EditorClassIdentifier:
--- !u!114 &-5347470499274537806
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -26,6 +38,99 @@ MonoBehaviour:
m_Name: DialogueClip
m_EditorClassIdentifier:
subtitle: "\u7EC8\u6781\u4E00\u53F7,\u6211\u4EEC\u6536\u5230\u4E86\u64A4\u79BB\u8BF7\u6C42,\u9884\u8BA145\u79D2\u540E\u5230\u8FBE"
--- !u!114 &-3433638841578412451
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3}
m_Name: Activation Track (1)
m_EditorClassIdentifier:
m_Version: 3
m_AnimClip: {fileID: 0}
m_Locked: 0
m_Muted: 0
m_CustomPlayableFullTypename:
m_Curves: {fileID: 0}
m_Parent: {fileID: 11400000}
m_Children: []
m_Clips:
- m_Version: 1
m_Start: 20
m_ClipIn: 0
m_Asset: {fileID: -7003756086648336395}
m_Duration: 46.96666666666667
m_TimeScale: 1
m_ParentTrack: {fileID: -3433638841578412451}
m_EaseInDuration: 0
m_EaseOutDuration: 0
m_BlendInDuration: 0
m_BlendOutDuration: 0
m_MixInCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_MixOutCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_BlendInCurveMode: 0
m_BlendOutCurveMode: 0
m_ExposedParameterNames: []
m_AnimationCurves: {fileID: 0}
m_Recordable: 0
m_PostExtrapolationMode: 0
m_PreExtrapolationMode: 0
m_PostExtrapolationTime: 0
m_PreExtrapolationTime: 0
m_DisplayName: Active
m_Markers:
m_Objects: []
m_PostPlaybackState: 3
--- !u!114 &-2054847407960935191
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -336,6 +441,7 @@ MonoBehaviour:
m_Tracks:
- {fileID: -2054847407960935191}
- {fileID: -465851578319353773}
- {fileID: -3433638841578412451}
- {fileID: 7155857144767593848}
m_FixedDuration: 0
m_EditorSettings: