Ascendance Games
New member
Bug: KinematicObjectManager is clearing some abilities cache when scene is unloaded but not rebuilding when scene reloads.
On line Line 948 within KinematicObjectManager.
KinematicObjectManager is clearing some abilities cache when scene is unloaded but not rebuilding when scene reloads. In result character abilities are null when UltimateCharacterLocomotion calls Awake on abilities.
Bug: SpawnPoint(s) will add multiple instances to SpawnPointManager as well add at wrong indexes if `int Grouping` value is set before SpawnPoint OnEnable runs.
Feature: SpawnPoint(s) should be accessible in the SpawnPointManager. Here's a handy accessor which can return them, with options.
Feature: Abilities should have an additional start option as "Button Not Held". In such scenarios ability would run long as button is not held, and stop when button is held, then resume again when not held.
*edit: fixed typos*
On line Line 948 within KinematicObjectManager.
KinematicObjectManager is clearing some abilities cache when scene is unloaded but not rebuilding when scene reloads. In result character abilities are null when UltimateCharacterLocomotion calls Awake on abilities.
Bug: SpawnPoint(s) will add multiple instances to SpawnPointManager as well add at wrong indexes if `int Grouping` value is set before SpawnPoint OnEnable runs.
Code:
///Hackish fix: add initialized check.
private void OnDisable()
{
SpawnPointManager.RemoveSpawnPoint(this);
m_initialized = false;
}
private void OnEnable()
{
SpawnPointManager.AddSpawnPoint(this);
m_initialized = true;
}
public int Grouping
{
get { return m_Grouping; }
set
{
if (m_Grouping != value) {
// The SpawnPointManager needs to be aware of the change so it can update its internal mapping.
if (Application.isPlaying && m_initialized) {
SpawnPointManager.UpdateSpawnPointGrouping(this, value);
}
m_Grouping = value;
}
}
}
Feature: SpawnPoint(s) should be accessible in the SpawnPointManager. Here's a handy accessor which can return them, with options.
Code:
/// <summary>
/// Returns a list of spawn points.
/// </summary>
/// <param name="grouping">Grouping of spawn points to return. If not specified all spawn points are returned.</param>
/// <returns></returns>
public static List<SpawnPoint> ReturnSpawnPoints(int? grouping = null)
{
return Instance.ReturnSpawnPointsInternal(grouping);
}
/// <summary>
/// Returns a list of spawn points.
/// </summary>
/// <param name="grouping">Grouping of spawn points to return. If not specified all spawn points are returned.</param>
/// <returns></returns>
private List<SpawnPoint> ReturnSpawnPointsInternal(int? grouping = null)
{
if (grouping == null)
{
return m_SpawnPoints;
}
else
{
if (grouping.Value != -1)
{
List<SpawnPoint> results;
if (!m_SpawnPointGroupings.TryGetValue(grouping.Value, out results))
Debug.LogError("Error: Unable to find a spawn point with the grouping index " + grouping);
return results;
}
else
{
return m_SpawnPoints;
}
}
}
Code:
//within GetPlacementInternal can replace
List<SpawnPoint> spawnPoints;
if (grouping != -1)
{
if (!m_SpawnPointGroupings.TryGetValue(grouping, out spawnPoints))
Debug.LogError("Error: Unable to find a spawn point with the grouping index " + grouping);
}
else
{
spawnPoints = m_SpawnPoints;
}
//with
List<SpawnPoint> spawnPoints = ReturnSpawnPointsInternal(grouping);
Feature: Abilities should have an additional start option as "Button Not Held". In such scenarios ability would run long as button is not held, and stop when button is held, then resume again when not held.
*edit: fixed typos*
Last edited: