# Conflicts:
#	Assets/_Content/Models/Environments/BodiesInWater.meta
#	Assets/_Content/Models/Environments/BodiesInWater/Materials.meta
#	Assets/_Content/Models/Environments/BodiesInWater/Shaders.meta
#	Assets/_Content/Models/Environments/HouseOfLeaves/Materials/M_houseOfLeaves_sand.mat
#	Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs
This commit is contained in:
2026-05-21 11:03:11 +01:00
65 changed files with 8287 additions and 742 deletions
@@ -35,6 +35,12 @@ namespace OctoCore.Components
public PlayerModes Mode = PlayerModes.FirstPerson;
public Orientations Orientation = Orientations.Camera;
[Tooltip("Allow position movement.")]
public bool AllowMove = true;
[Tooltip("Allow looking around.")]
public bool AllowLook = true;
[Tooltip("Walk speed (km/h).")]
public float WalkSpeed = 10;
@@ -387,7 +393,7 @@ namespace OctoCore.Components
else
moveDelta.y = -0.1f;
if (_references.Controller)
if (_references.Controller && _references.Controller.enabled)
_references.Controller.Move(moveDelta);
else
transform.position += moveDelta;
@@ -401,8 +407,10 @@ namespace OctoCore.Components
{
Vector2 delta = (State.IsPaused || !State.IsFocussed) ? Vector2.zero : _lookInput;
float mouseX = delta.x * _firstPerson.SensitivityX;
float mouseY = delta.y * _firstPerson.SensitivityY * -1;
if (_settings.AllowLook)
{
float mouseX = delta.x * _firstPerson.SensitivityX;
float mouseY = delta.y * _firstPerson.SensitivityY * -1;
State.Yaw += mouseX;
State.Pitch = Mathf.Clamp(State.Pitch + mouseY, _firstPerson.MinPitch, _firstPerson.MaxPitch);
@@ -48,11 +48,14 @@ namespace OctoCore.Components
[Tooltip("Play on Awake")]
public bool PlayOnAwake = true;
[Tooltip("Random Time Offset")]
public bool RandomOffset = true;
[Tooltip("Animation speed multiplier")]
public float Duration = 4;
[Tooltip("Time offset to desynchronize multiple animations")]
public float TimeOffset = 0;
[Tooltip("Cycle offset to desynchronize multiple animations")]
[Range(0, 1)] public float CycleOffset = 0;
[Tooltip("Translation amount in local space (meters)")]
public Vector3 Translation = Vector3.zero;
@@ -100,8 +103,10 @@ namespace OctoCore.Components
_state.InitialPosition = transform.localPosition;
_state.InitialRotation = transform.localRotation;
_state.InitialScale = transform.localScale;
_state.CurrentTime = _settings.TimeOffset;
_state.CurrentTime = _settings.CycleOffset;
_state.IsFinished = false;
_timeOffset = Time.timeSinceLevelLoad;
}
void Update()
@@ -109,7 +114,7 @@ namespace OctoCore.Components
if (_state.IsFinished || !_started)
return;
_state.CurrentTime = Time.timeSinceLevelLoad + _settings.TimeOffset * _settings.Duration - _timeOffset;
_state.CurrentTime = Time.timeSinceLevelLoad + _settings.CycleOffset * _settings.Duration - _timeOffset + (_settings.RandomOffset ? transform.GetSiblingIndex() * 6.7f : 0);
float normalizedTime = GetNormalizedTime(_state.CurrentTime);
float easedTime = ApplyEasing(normalizedTime);
@@ -136,7 +141,7 @@ namespace OctoCore.Components
/// </summary>
public void ResetAnimation()
{
_state.CurrentTime = _settings.TimeOffset;
_state.CurrentTime = _settings.CycleOffset;
_state.IsFinished = false;
transform.localPosition = _state.InitialPosition;
transform.localRotation = _state.InitialRotation;