```
feat(gameplay): 更新单位属性和材质配置 - 调整多个单位的基础生命值和攻击力数值平衡 - 修改CoreBattleGround材质的纹理缩放比例 - 更新地砖材质颜色为白色 - 优化纹理资源设置,调整最大纹理尺寸并添加PlayableAds平台支持 - 修复弓箭手技能目标查找逻辑,改用统一的敌人检测方法 - 为水晶矿添加中立阵营设置和光球视觉效果同步 - 调整预制体中的全局缩放参数 - 为狼人和石巨人添加NavMeshAgent组件支持 - 优化水晶矿血条显示位置计算方式 ```
This commit is contained in:
1 parent
0e7de5f885
commit
53d95802e5
448 files changed
+133333
-472
No files matched your search
+94
@@ -0,0 +1,94 @@
|
||||
#if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Unity.InternalBridge
|
||||
{
|
||||
/// <summary>
|
||||
/// Reflection-based wrapper around UnityEditor.Connect.UnityConnect (an internal type).
|
||||
/// Using reflection avoids depending on the magic
|
||||
/// `Unity.InternalAPIEditorBridge.<contract>` asmdef whose contract number changes
|
||||
/// between Unity major versions (001 in 2019, 010 in 2020, 016/017 in 2021+, ...).
|
||||
/// </summary>
|
||||
public static class UnityConnectSession
|
||||
{
|
||||
private static readonly Type s_Type;
|
||||
private static readonly object s_Instance;
|
||||
private static readonly MethodInfo s_GetAccessToken;
|
||||
private static readonly MethodInfo s_GetUserId;
|
||||
private static readonly MethodInfo s_GetUserName;
|
||||
private static readonly PropertyInfo s_LoggedIn;
|
||||
private static readonly MethodInfo s_RefreshAccessToken;
|
||||
private static readonly MethodInfo s_ShowLogin;
|
||||
|
||||
static UnityConnectSession()
|
||||
{
|
||||
try
|
||||
{
|
||||
var editorAssembly = typeof(UnityEditor.Editor).Assembly;
|
||||
s_Type = editorAssembly.GetType("UnityEditor.Connect.UnityConnect");
|
||||
if (s_Type == null) return;
|
||||
|
||||
var instanceProp = s_Type.GetProperty("instance",
|
||||
BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (instanceProp == null) return;
|
||||
s_Instance = instanceProp.GetValue(null);
|
||||
if (s_Instance == null) return;
|
||||
|
||||
const BindingFlags inst = BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic;
|
||||
s_GetAccessToken = s_Type.GetMethod("GetAccessToken", inst, null, Type.EmptyTypes, null);
|
||||
s_GetUserId = s_Type.GetMethod("GetUserId", inst, null, Type.EmptyTypes, null);
|
||||
s_GetUserName = s_Type.GetMethod("GetUserName", inst, null, Type.EmptyTypes, null);
|
||||
s_LoggedIn = s_Type.GetProperty("loggedIn", inst);
|
||||
s_RefreshAccessToken = s_Type.GetMethod("RefreshAccessToken", inst, null, new[] { typeof(Action<bool>) }, null);
|
||||
s_ShowLogin = s_Type.GetMethod("ShowLogin", inst, null, Type.EmptyTypes, null);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Reflection bind failure: leave fields null; methods will return safe defaults.
|
||||
}
|
||||
}
|
||||
|
||||
private static string InvokeString(MethodInfo mi)
|
||||
{
|
||||
if (mi == null || s_Instance == null) return string.Empty;
|
||||
try { return mi.Invoke(s_Instance, null) as string ?? string.Empty; }
|
||||
catch { return string.Empty; }
|
||||
}
|
||||
|
||||
public static string GetAccessToken() => InvokeString(s_GetAccessToken);
|
||||
public static string GetUserId() => InvokeString(s_GetUserId);
|
||||
public static string GetUserName() => InvokeString(s_GetUserName);
|
||||
|
||||
public static bool IsLoggedIn()
|
||||
{
|
||||
if (s_LoggedIn == null || s_Instance == null) return false;
|
||||
try
|
||||
{
|
||||
var v = s_LoggedIn.GetValue(s_Instance);
|
||||
return v is bool b && b;
|
||||
}
|
||||
catch { return false; }
|
||||
}
|
||||
|
||||
public static void RefreshAccessToken(Action<bool> onRefreshed)
|
||||
{
|
||||
if (s_RefreshAccessToken == null || s_Instance == null)
|
||||
{
|
||||
onRefreshed?.Invoke(false);
|
||||
return;
|
||||
}
|
||||
try { s_RefreshAccessToken.Invoke(s_Instance, new object[] { onRefreshed }); }
|
||||
catch { onRefreshed?.Invoke(false); }
|
||||
}
|
||||
|
||||
public static void ShowLogin()
|
||||
{
|
||||
if (s_ShowLogin == null || s_Instance == null) return;
|
||||
try { s_ShowLogin.Invoke(s_Instance, null); }
|
||||
catch { /* ignore */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35a1b76bb29253344a7289b78ef4aece
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user