浏览代码

refactor: Remove unused usings, use Unity asserts, small style fixes.

/main
Luke Stampfli 4 年前
当前提交
2065597e
共有 5 个文件被更改,包括 10 次插入15 次删除
  1. 1
      Assets/BossRoom/Scripts/Client/ClientInputSender.cs
  2. 2
      Assets/BossRoom/Scripts/Server/Game/Action/ChaseAction.cs
  3. 3
      Assets/BossRoom/Scripts/Server/Navigation/DynamicNavPath.cs
  4. 12
      Assets/BossRoom/Scripts/Server/Navigation/NavigationSystem.cs
  5. 7
      Assets/BossRoom/Scripts/Server/ServerCharacterMovement.cs

1
Assets/BossRoom/Scripts/Client/ClientInputSender.cs


using System;
using MLAPI;
using UnityEngine;

2
Assets/BossRoom/Scripts/Server/Game/Action/ChaseAction.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MLAPI;

3
Assets/BossRoom/Scripts/Server/Navigation/DynamicNavPath.cs


/// <summary>
/// Call this to recalculate the path when the navigation mesh or dynamic obstacles changed.
/// </summary>
public void OnNavMeshChanged()
private void OnNavMeshChanged()
{
RecalculatePath();
}

public void Clear()
{
m_Path.Clear();
;
}
/// <summary>

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


using NUnit.Framework;
using UnityEngine.Assertions;
namespace BossRoom.Server
{

/// <summary>
/// Whether all paths need to be recalculated in the next fixed update.
/// </summary>
private bool navMeshChanged;
private bool m_NavMeshChanged;
navMeshChanged = true;
m_NavMeshChanged = true;
navMeshChanged = true;
m_NavMeshChanged = true;
if (navMeshChanged)
if (m_NavMeshChanged)
navMeshChanged = false;
m_NavMeshChanged = false;
}
}

7
Assets/BossRoom/Scripts/Server/ServerCharacterMovement.cs


using MLAPI;
using NUnit.Framework;
using UnityEditor;
using UnityEngine.Assertions;
namespace BossRoom.Server
{

{
if (gameObject.scene.rootCount > 1) // Hacky way for checking if this is a scene object or a prefab instance and not a prefab definition.
{
Assert.NotNull(
GameObject.FindGameObjectWithTag(NavigationSystem.NavigationSytemTag)?.GetComponent<NavigationSystem>(),
Assert.IsTrue(
GameObject.FindGameObjectWithTag(NavigationSystem.NavigationSytemTag)?.GetComponent<NavigationSystem>() != null,
$"NavigationSystem not found. Is there a NavigationSystem Behaviour in the Scene and does its GameObject have the {NavigationSystem.NavigationSytemTag} tag? {gameObject.scene.name}"
);
}

正在加载...
取消
保存