Skip to content

Commit

Permalink
feat: structure refactor (3) gameplay and infrastructure cleanup [MTT…
Browse files Browse the repository at this point in the history
…-2623] (Unity-Technologies#674)

* Infrastructure and Gameplay folder and assembly refactor

* added reference to utils asmdef from applicationcontroller.asmdef
  • Loading branch information
pdeschain authored Jun 2, 2022
1 parent 04bf923 commit 80b1d14
Show file tree
Hide file tree
Showing 282 changed files with 110 additions and 249 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"GUID:e3abc1ceb6eae4836a8ff106702e66e5",
"GUID:1491147abca9d7d4bb7105af628b223e",
"GUID:e0cd26848372d4e5c891c569017e11f1",
"GUID:e9e5562f77c754b2ca364915385b3d43"
"GUID:e9e5562f77c754b2ca364915385b3d43",
"GUID:59b3bd604d0445f583783872c3e648fc"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand All @@ -19,4 +20,4 @@
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
}
18 changes: 15 additions & 3 deletions Assets/Scripts/Audio/Unity.BossRoom.Audio.asmdef
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"name": "Unity.BossRoom.Audio",
"references":[ "GUID:ec2e12d3de28e40839f9a0b685184f49" ]
}
"name": "Unity.BossRoom.Audio",
"rootNamespace": "",
"references": [
"GUID:59b3bd604d0445f583783872c3e648fc"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Client/State.meta

This file was deleted.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Server.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Server/AIState.meta

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Shared.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Shared/Action.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Shared/NetworkedEntities.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Shared/ScriptableObjects.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/Gameplay/Shared/State.meta

This file was deleted.

5 changes: 3 additions & 2 deletions Assets/Scripts/Gameplay/Unity.BossRoom.Gameplay.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"GUID:f9a1f64e21cf44ebd850a08ad9afa8fe",
"GUID:5ed68ed74b4874cce9e11f74a1f5e9ae",
"GUID:b44ecd51ecea1474ebbb97f7d7c7cf81",
"GUID:e9e5562f77c754b2ca364915385b3d43"
"GUID:e9e5562f77c754b2ca364915385b3d43",
"GUID:59b3bd604d0445f583783872c3e648fc"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand All @@ -28,4 +29,4 @@
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
}
8 changes: 0 additions & 8 deletions Assets/Scripts/Infrastructure/Development.meta

This file was deleted.

38 changes: 0 additions & 38 deletions Assets/Scripts/Infrastructure/Development/NetworkingManagerHUD.cs

This file was deleted.

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Unity.BossRoom.Infrastructure.Editor",
"name": "Unity.BossRoom.Infrastructure.ScriptableObjectArchitecture.Editor",
"rootNamespace": "",
"references": [
"GUID:1491147abca9d7d4bb7105af628b223e",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions Assets/Scripts/Utils/PositionLerper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using UnityEngine;

namespace Unity.Multiplayer.Samples.BossRoom.Visual
{
/// <summary>
/// Utility struct to linearly interpolate between two Vector3 values. Allows for flexible linear interpolations
/// where current and target change over time.
/// </summary>
public struct PositionLerper
{
// Calculated start for the most recent interpolation
Vector3 m_LerpStart;

// Calculated time elapsed for the most recent interpolation
float m_CurrentLerpTime;

// The duration of the interpolation, in seconds
float m_LerpTime;

public PositionLerper(Vector3 start, float lerpTime)
{
m_LerpStart = start;
m_CurrentLerpTime = 0f;
m_LerpTime = lerpTime;
}

/// <summary>
/// Linearly interpolate between two Vector3 values.
/// </summary>
/// <param name="current"> Start of the interpolation. </param>
/// <param name="target"> End of the interpolation. </param>
/// <returns> A Vector3 value between current and target. </returns>
public Vector3 LerpPosition(Vector3 current, Vector3 target)
{
if (current != target)
{
m_LerpStart = current;
m_CurrentLerpTime = 0f;
}

m_CurrentLerpTime += Time.deltaTime;
if (m_CurrentLerpTime > m_LerpTime)
{
m_CurrentLerpTime = m_LerpTime;
}

var lerpPercentage = m_CurrentLerpTime / m_LerpTime;

return Vector3.Lerp(m_LerpStart, target, lerpPercentage);
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 80b1d14

Please sign in to comment.