Skip to content

Commit

Permalink
modified printer and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
michael811125 committed Dec 6, 2023
1 parent de6d347 commit ce3ca79
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Cysharp.Threading.Tasks;
using OxGFrame.AssetLoader;
using OxGKit.LoggingSystem;
using UnityEngine;

namespace OxGFrame.CoreFrame.CPFrame
Expand Down Expand Up @@ -31,7 +32,7 @@ protected async UniTask<GameObject> LoadGameObjectAsync(string packageName, stri

if (obj == null)
{
Debug.LogWarning(string.Format("【 path: {0} 】asset not found at this path!!!", assetName));
Logging.PrintWarning<Logger>(string.Format("【 path: {0} 】asset not found at this path!!!", assetName));
return null;
}

Expand All @@ -46,7 +47,7 @@ protected GameObject LoadGameObject(string packageName, string assetName, Progre

if (obj == null)
{
Debug.LogWarning(string.Format("【 path: {0} 】asset not found at this path!!!", assetName));
Logging.PrintWarning<Logger>(string.Format("【 path: {0} 】asset not found at this path!!!", assetName));
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,11 @@ protected virtual async UniTask<GameObject> LoadGameObject(string packageName, s
/// <returns></returns>
protected async UniTask<T> LoadIntoAllCache(string packageName, string assetName, uint priority, Progression progression, bool isPreloadMode, Transform parent = null)
{
if (this.HasInLoadingFlags(assetName)) return null;
if (this.HasInLoadingFlags(assetName))
{
Logging.PrintWarning<Logger>($"Asset: {assetName} is loading...");
return null;
}

GameObject asset;
T fBase = null;
Expand Down Expand Up @@ -745,7 +749,7 @@ public static T GetCopyOf<T>(this T comp, T other) where T : Component
Type othersType = other.GetType();
if (type != othersType)
{
Debug.LogError($"The type \"{type.AssemblyQualifiedName}\" of \"{comp}\" does not match the type \"{othersType.AssemblyQualifiedName}\" of \"{other}\"!");
Logging.PrintError<Logger>($"The type \"{type.AssemblyQualifiedName}\" of \"{comp}\" does not match the type \"{othersType.AssemblyQualifiedName}\" of \"{other}\"!");
return null;
}

Expand Down Expand Up @@ -787,11 +791,11 @@ internal static class GameObjectExtensions
/// <summary>
/// Checks if a GameObject has been destroyed.
/// </summary>
/// <param name="gameObject">GameObject reference to check for destructedness</param>
/// <param name="gameObject">GameObject reference to check for destructiveness</param>
/// <returns>If the game object has been marked as destroyed by UnityEngine</returns>
public static bool IsDestroyed(this GameObject gameObject)
{
// UnityEngine overloads the == opeator for the GameObject type
// UnityEngine overloads the == operator for the GameObject type
// and returns null when the object has been destroyed, but
// actually the object is still there but has not been cleaned up yet
// if we test both we can determine if the object has been destroyed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public override async UniTask<SRBase> Show(int groupId, string packageName, stri
{
if (this.CheckIsShowing(assetName))
{
Debug.LogWarning($"SR: {assetName} already exists!!!");
Logging.PrintWarning<Logger>($"SR: {assetName} already exists!!!");
return null;
}
}
Expand All @@ -114,7 +114,7 @@ public override async UniTask<SRBase> Show(int groupId, string packageName, stri
var srBase = await this.LoadIntoAllCache(packageName, assetName, priority, progression, false, parent);
if (srBase == null)
{
Debug.LogWarning($"SR: {assetName} => Asset not found at this path!!!");
Logging.PrintWarning<Logger>($"SR: {assetName} => Asset not found at this path!!!");
return null;
}

Expand Down Expand Up @@ -272,7 +272,7 @@ private void _Reveal(string assetName)

if (this.CheckIsShowing(assetName))
{
Debug.LogWarning($"SR: {assetName} already reveal!!!");
Logging.PrintWarning<Logger>($"SR: {assetName} already reveal!!!");
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEngine;
using OxGKit.LoggingSystem;
using UnityEngine;
using UnityEngine.UI;

namespace OxGFrame.CoreFrame.UIFrame
Expand All @@ -18,7 +19,7 @@ public void InitFreeze()
freezeBtn.transition = Selectable.Transition.None;
freezeBtn.onClick.AddListener(() =>
{
Debug.LogWarning("<color=#42BBFF>UI has been frozen</color>");
Logging.PrintWarning<Logger>("<color=#42BBFF>UI has been frozen</color>");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public override async UniTask<UIBase> Show(int groupId, string packageName, stri
{
if (this.CheckIsShowing(assetName))
{
Debug.LogWarning($"UI: {assetName} already exists!!!");
Logging.PrintWarning<Logger>($"UI: {assetName} already exists!!!");
return null;
}
}
Expand All @@ -403,7 +403,7 @@ public override async UniTask<UIBase> Show(int groupId, string packageName, stri
var uiBase = await this.LoadIntoAllCache(packageName, assetName, priority, progression, false);
if (uiBase == null)
{
Debug.LogWarning($"UI: {assetName} => Asset not found at this path!!!");
Logging.PrintWarning<Logger>($"UI: {assetName} => Asset not found at this path!!!");
return null;
}

Expand Down Expand Up @@ -705,7 +705,7 @@ private void _Reveal(string assetName)

if (this.CheckIsShowing(assetName))
{
Debug.LogWarning($"UI: {assetName} already reveal!!!");
Logging.PrintWarning<Logger>($"UI: {assetName} already reveal!!!");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static AudioManager GetInstance()
lock (_locker)
{
_instance = FindObjectOfType<AudioManager>();
if (_instance == null) Debug.LogWarning("<color=#FF0000>Connot found 【AudioManager Component】, Please to check your 【AudioManager GameObject】.</color>");
if (_instance == null) Logging.PrintWarning<Logger>("<color=#FF0000>Cannot found 【AudioManager Component】, Please to check your 【AudioManager GameObject】.</color>");
}
}
return _instance;
Expand Down Expand Up @@ -232,7 +232,7 @@ public override async UniTask<AudioBase[]> Play(string packageName, string asset
switch (main.audioType.soundType)
{
case SoundType.Sole:
Debug.LogWarning(string.Format("【Audio => SoundType: {0}】{1} already played!!!", main.audioType.soundType, assetName));
Logging.PrintWarning<Logger>(string.Format("【Audio => SoundType: {0}】{1} already played!!!", main.audioType.soundType, assetName));
return audBases;
}
}
Expand All @@ -248,7 +248,7 @@ public override async UniTask<AudioBase[]> Play(string packageName, string asset
AudioBase audBase = await this.CloneAsset<AudioBase>(assetName, go, parent, spawnParent);
if (audBase == null)
{
Debug.LogWarning(string.Format("Asset not found at this path!!!【Audio】: {0}", assetName));
Logging.PrintWarning<Logger>(string.Format("Asset not found at this path!!!【Audio】: {0}", assetName));
return new AudioBase[] { };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected virtual async UniTask<GameObject> LoadGameObject(string packageName, s

if (obj == null)
{
Debug.LogWarning(string.Format("【 path: {0} 】asset not found at this path!!!", assetName));
Logging.PrintWarning<Logger>(string.Format("【 path: {0} 】asset not found at this path!!!", assetName));
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void Connect(NetOption netOption)
{
if (this._socket == null)
{
Debug.LogError("The socket cannot be null, Please init first.");
Logging.PrintError<Logger>("The socket cannot be null, Please init first.");
return;
}

Expand Down
7 changes: 4 additions & 3 deletions Assets/OxGFrame/NetFrame/Scripts/Runtime/Core/NetManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using OxGKit.LoggingSystem;
using System.Collections.Generic;
using UnityEngine;

namespace OxGFrame.NetFrame
Expand Down Expand Up @@ -80,7 +81,7 @@ public void Connect(NetOption netOption, byte nnId = 0)
{
this._netNodes[nnId].Connect(netOption);
}
else Debug.LogWarning(string.Format("The NodeId: {0} Can't Found !!! Connect Failed.", nnId));
else Logging.PrintWarning<Logger>(string.Format("The NodeId: {0} Can't Found !!! Connect Failed.", nnId));
}

/// <summary>
Expand Down Expand Up @@ -112,7 +113,7 @@ public bool Send(byte[] buffer, byte nnId = 0)
}
else
{
Debug.LogWarning(string.Format("The NodeId: {0} Can't Found !!! Send Failed.", nnId));
Logging.PrintWarning<Logger>(string.Format("The NodeId: {0} Can't Found !!! Send Failed.", nnId));
return false;
}
}
Expand Down

0 comments on commit ce3ca79

Please sign in to comment.