diff --git a/Assets/BossRoom/Scripts/Client/Game/Action/ChargedLaunchProjectileActionFX.cs b/Assets/BossRoom/Scripts/Client/Game/Action/ChargedLaunchProjectileActionFX.cs index dc940f431..2b671138d 100644 --- a/Assets/BossRoom/Scripts/Client/Game/Action/ChargedLaunchProjectileActionFX.cs +++ b/Assets/BossRoom/Scripts/Client/Game/Action/ChargedLaunchProjectileActionFX.cs @@ -21,7 +21,7 @@ public ChargedLaunchProjectileActionFX(ref ActionRequestData data, ClientCharact /// (like mobile devices), it can lead to major performance problems. On mobile platforms, visual graphics should /// use object-pooling (i.e. reusing the same GameObjects repeatedly). But that's outside the scope of this demo. /// - private List m_Graphics; + private List m_Graphics = new List(); private bool m_ChargeEnded; diff --git a/Assets/BossRoom/Scripts/Client/Game/Action/FXProjectileTargetedActionFX.cs b/Assets/BossRoom/Scripts/Client/Game/Action/FXProjectileTargetedActionFX.cs index 0706399a7..0b81b0c7d 100644 --- a/Assets/BossRoom/Scripts/Client/Game/Action/FXProjectileTargetedActionFX.cs +++ b/Assets/BossRoom/Scripts/Client/Game/Action/FXProjectileTargetedActionFX.cs @@ -51,8 +51,8 @@ public override bool Update() if (TimeRunning >= Description.ExecTimeSeconds && m_Projectile == null) { // figure out how long the pretend-projectile will be flying to the target - Vector3 targetPos = m_Target ? m_Target.transform.position : m_Data.Position; - float initialDistance = Vector3.Distance(targetPos, m_Parent.transform.position); + var targetPos = m_Target ? m_Target.transform.position : m_Data.Position; + var initialDistance = Vector3.Distance(targetPos, m_Parent.transform.position); m_ProjectileDuration = initialDistance / Description.Projectiles[0].Speed_m_s; // create the projectile. It will control itself from here on out @@ -63,11 +63,6 @@ public override bool Update() return TimeRunning <= m_ProjectileDuration + Description.ExecTimeSeconds; } - public override void OnAnimEvent(string id) - { - //Debug.Log($"Anim event: {id}"); - } - public override void Cancel() { if (m_Projectile) @@ -133,9 +128,9 @@ private bool IsParentAnNPC() private FXProjectile SpawnAndInitializeProjectile() { - GameObject projectileGO = Object.Instantiate(Description.Projectiles[0].ProjectilePrefab, m_Parent.transform.position, m_Parent.transform.rotation, null); + var projectileGO = Object.Instantiate(Description.Projectiles[0].ProjectilePrefab, m_Parent.transform.position, m_Parent.transform.rotation, null); - FXProjectile projectile = projectileGO.GetComponent(); + var projectile = projectileGO.GetComponent(); if (!projectile) { throw new System.Exception($"FXProjectileTargetedAction tried to spawn projectile {projectileGO.name}, as dictated for action type {Data.ActionTypeEnum}, but the object doesn't have a FXProjectile component!"); diff --git a/Assets/BossRoom/Scripts/Server/Game/Entity/ServerWaveSpawner.cs b/Assets/BossRoom/Scripts/Server/Game/Entity/ServerWaveSpawner.cs index 22ad103ea..a21bbfa82 100644 --- a/Assets/BossRoom/Scripts/Server/Game/Entity/ServerWaveSpawner.cs +++ b/Assets/BossRoom/Scripts/Server/Game/Entity/ServerWaveSpawner.cs @@ -227,7 +227,7 @@ NetworkObject SpawnPrefab() var clone = Instantiate(m_NetworkedPrefab, m_SpawnPositions[posIdx].position, m_SpawnPositions[posIdx].rotation); if (!clone.IsSpawned) { - clone.Spawn(); + clone.Spawn(null, true); } if (m_SpawnedEntityDetectDistance > -1) diff --git a/Assets/BossRoom/Scripts/Shared/Game/Action/ActionRequestData.cs b/Assets/BossRoom/Scripts/Shared/Game/Action/ActionRequestData.cs index 3b25d3a0a..856eba154 100644 --- a/Assets/BossRoom/Scripts/Shared/Game/Action/ActionRequestData.cs +++ b/Assets/BossRoom/Scripts/Shared/Game/Action/ActionRequestData.cs @@ -60,21 +60,6 @@ public enum ActionLogic //O__O adding a new ActionLogic branch? Update Action.MakeAction! } - /// - /// Retrieves static information about ActionLogics - /// - public static class ActionLogicUtils - { - /// - /// When requesting an action with this type of ActionLogic, do we need to store the Position where player clicked? - /// (We separate this out so that we don't need to send the extra Vector3 across the network if unneeded.) - /// - public static bool IsPositionUsed(ActionLogic logic) - { - return logic == ActionLogic.RangedFXTargeted; - } - - } /// /// Comprehensive class that contains information needed to play back any action on the server. This is what gets sent client->server when @@ -179,4 +164,3 @@ public void NetworkSerialize(NetworkSerializer serializer) } } } -