浏览代码

refactor: Explicit private declarations, Initialize events as empty delegates, move NavMeshComponents license file

/main
Luke Stampfli 4 年前
当前提交
bac2c293
共有 4 个文件被更改,包括 6 次插入6 次删除
  1. 8
      Assets/BossRoom/Scripts/Server/Navigation/DynamicNavObstacle.cs
  2. 4
      Assets/BossRoom/Scripts/Server/Navigation/NavigationSystem.cs
  3. 0
      /Assets/BossRoom/UnityTechnologies/NavMeshComponents/LICENSE
  4. 0
      /Assets/BossRoom/UnityTechnologies/NavMeshComponents/LICENSE.meta

8
Assets/BossRoom/Scripts/Server/Navigation/DynamicNavObstacle.cs


{
private NavigationSystem m_NavigationSystem;
void Awake()
private void Awake()
void OnValidate()
private void OnValidate()
{
if (gameObject.scene.rootCount > 1) // Hacky way for checking if this is a scene object or a prefab instance and not a prefab definition.
{

}
}
void OnEnable()
private void OnEnable()
void OnDisable()
private void OnDisable()
{
m_NavigationSystem.OnDynamicObstacleDisabled();
}

4
Assets/BossRoom/Scripts/Server/Navigation/NavigationSystem.cs


/// <summary>
/// Event that gets invoked when the navigation mesh changed. This happens when dynamic obstacles move or get active
/// </summary>
public event System.Action OnNavigationMeshChanged;
public event System.Action OnNavigationMeshChanged = delegate{};
/// <summary>
/// Whether all paths need to be recalculated in the next fixed update.

// This is done in fixed update to make sure that only one expensive global recalculation happens per fixed update.
if (navMeshChanged)
{
OnNavigationMeshChanged?.Invoke();
OnNavigationMeshChanged.Invoke();
navMeshChanged = false;
}
}

/Assets/BossRoom/UnityTechnologies/LICENSE → /Assets/BossRoom/UnityTechnologies/NavMeshComponents/LICENSE

/Assets/BossRoom/UnityTechnologies/LICENSE.meta → /Assets/BossRoom/UnityTechnologies/NavMeshComponents/LICENSE.meta

正在加载...
取消
保存