2021년 4학년 1학기 기업연계프로젝트2 컴퓨터소프트웨어공학과 <원광투어팀> 팀장 : 송유진 팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

57 lines
2.2 KiB

using UnityEngine;
namespace Unity.FPS.Game
{
public static class DebugUtility
{
public static void HandleErrorIfNullGetComponent<TO, TS>(Component component, Component source,
GameObject onObject)
{
#if UNITY_EDITOR
if (component == null)
{
Debug.LogError("Error: Component of type " + typeof(TS) + " on GameObject " + source.gameObject.name +
" expected to find a component of type " + typeof(TO) + " on GameObject " +
onObject.name + ", but none were found.");
}
#endif
}
public static void HandleErrorIfNullFindObject<TO, TS>(UnityEngine.Object obj, Component source)
{
#if UNITY_EDITOR
if (obj == null)
{
Debug.LogError("Error: Component of type " + typeof(TS) + " on GameObject " + source.gameObject.name +
" expected to find an object of type " + typeof(TO) +
" in the scene, but none were found.");
}
#endif
}
public static void HandleErrorIfNoComponentFound<TO, TS>(int count, Component source, GameObject onObject)
{
#if UNITY_EDITOR
if (count == 0)
{
Debug.LogError("Error: Component of type " + typeof(TS) + " on GameObject " + source.gameObject.name +
" expected to find at least one component of type " + typeof(TO) + " on GameObject " +
onObject.name + ", but none were found.");
}
#endif
}
public static void HandleWarningIfDuplicateObjects<TO, TS>(int count, Component source, GameObject onObject)
{
#if UNITY_EDITOR
if (count > 1)
{
Debug.LogWarning("Warning: Component of type " + typeof(TS) + " on GameObject " +
source.gameObject.name +
" expected to find only one component of type " + typeof(TO) + " on GameObject " +
onObject.name + ", but several were found. First one found will be selected.");
}
#endif
}
}
}