Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </remarks>
private List<SpecialFXGraphic> m_Graphics;
private List<SpecialFXGraphic> m_Graphics = new List<SpecialFXGraphic>();

private bool m_ChargeEnded;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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<FXProjectile>();
var projectile = projectileGO.GetComponent<FXProjectile>();
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!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 0 additions & 16 deletions Assets/BossRoom/Scripts/Shared/Game/Action/ActionRequestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ public enum ActionLogic
//O__O adding a new ActionLogic branch? Update Action.MakeAction!
}

/// <summary>
/// Retrieves static information about ActionLogics
/// </summary>
public static class ActionLogicUtils
{
/// <summary>
/// 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.)
/// </summary>
public static bool IsPositionUsed(ActionLogic logic)
{
return logic == ActionLogic.RangedFXTargeted;
}

}

/// <summary>
/// Comprehensive class that contains information needed to play back any action on the server. This is what gets sent client->server when
Expand Down Expand Up @@ -179,4 +164,3 @@ public void NetworkSerialize(NetworkSerializer serializer)
}
}
}