脚本添加
This commit is contained in:
parent
fbccde859f
commit
2cc8b2e942
8
EintooAR/Assets/GameScripts/HotFix.meta
Normal file
8
EintooAR/Assets/GameScripts/HotFix.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cc0dc9c73b236e499395263b0395824
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
EintooAR/Assets/GameScripts/HotFix/GameBase.meta
Normal file
8
EintooAR/Assets/GameScripts/HotFix/GameBase.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6635aa4e94cc66546b8b89c48f0a0099
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
79
EintooAR/Assets/GameScripts/HotFix/GameBase/BaseLogicSys.cs
Normal file
79
EintooAR/Assets/GameScripts/HotFix/GameBase/BaseLogicSys.cs
Normal file
@ -0,0 +1,79 @@
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础LogicSys,生命周期由TEngine实现,推荐给系统实现,
|
||||
/// 减少多余的Mono,保持系统层面只有一个Update。
|
||||
/// 用主Mono来驱动LogicSys的生命周期。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">逻辑系统类型。</typeparam>
|
||||
public abstract class BaseLogicSys<T> : ILogicSys where T : new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static bool HasInstance => _instance != null;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
#region virtual function
|
||||
public virtual bool OnInit()
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void OnStart()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnLateUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnFixedUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnRoleLogin()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnRoleLogout()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDrawGizmos()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnApplicationPause(bool pause)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnMapChanged()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc4ce19b17fd4277951d189b66f503e2
|
||||
timeCreated: 1683120353
|
@ -0,0 +1,309 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 通过LogicSys来驱动且具备Unity完整生命周期的单例(不继承MonoBehaviour)。
|
||||
/// <remarks>Update、FixUpdate以及LateUpdate这些敏感帧更新需要加上对应的Attribute以最优化性能。</remarks>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">完整生命周期的类型。</typeparam>
|
||||
public abstract class BehaviourSingleton<T> : BaseBehaviourSingleton where T : BaseBehaviourSingleton, new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
Log.Assert(_instance != null);
|
||||
_instance.Awake();
|
||||
RegSingleton(_instance);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
private static void RegSingleton(BaseBehaviourSingleton inst)
|
||||
{
|
||||
BehaviourSingleSystem.Instance.RegSingleton(inst);
|
||||
}
|
||||
}
|
||||
|
||||
#region Attribute
|
||||
|
||||
/// <summary>
|
||||
/// 帧更新属性。
|
||||
/// <remarks>适用于BehaviourSingleton。</remarks>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class UpdateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物理帧更新属性。
|
||||
/// <remarks>适用于BehaviourSingleton。</remarks>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class FixedUpdateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 后帧更新属性。
|
||||
/// <remarks>适用于BehaviourSingleton。</remarks>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class LateUpdateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RoleLoginAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RoleLogoutAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 基础Behaviour单例。
|
||||
/// <remarks>(抽象类)</remarks>
|
||||
/// </summary>
|
||||
public abstract class BaseBehaviourSingleton
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否已经Start。
|
||||
/// </summary>
|
||||
public bool IsStart = false;
|
||||
|
||||
public virtual void Awake()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Start()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 帧更新。
|
||||
/// <remarks>需要UpdateAttribute。</remarks>
|
||||
/// </summary>
|
||||
public virtual void Update()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 后帧更新。
|
||||
/// <remarks>需要LateUpdateAttribute。</remarks>
|
||||
/// </summary>
|
||||
public virtual void LateUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物理帧更新。
|
||||
/// <remarks>需要FixedUpdateAttribute。</remarks>
|
||||
/// </summary>
|
||||
public virtual void FixedUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnPause()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnResume()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDrawGizmos()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过LogicSys来驱动且具备Unity完整生命周期的驱动系统(不继承MonoBehaviour)。
|
||||
/// </summary>
|
||||
public sealed class BehaviourSingleSystem : BaseLogicSys<BehaviourSingleSystem>
|
||||
{
|
||||
private readonly List<BaseBehaviourSingleton> _listInst = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listStart = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listUpdate = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listLateUpdate = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listFixedUpdate = new List<BaseBehaviourSingleton>();
|
||||
|
||||
/// <summary>
|
||||
/// 注册单例。
|
||||
/// <remarks>调用Instance时自动调用。</remarks>
|
||||
/// </summary>
|
||||
/// <param name="inst">单例实例。</param>
|
||||
internal void RegSingleton(BaseBehaviourSingleton inst)
|
||||
{
|
||||
Log.Assert(!_listInst.Contains(inst));
|
||||
_listInst.Add(inst);
|
||||
_listStart.Add(inst);
|
||||
if (HadAttribute<UpdateAttribute>(inst.GetType()))
|
||||
{
|
||||
_listUpdate.Add(inst);
|
||||
}
|
||||
|
||||
if (HadAttribute<LateUpdateAttribute>(inst.GetType()))
|
||||
{
|
||||
_listLateUpdate.Add(inst);
|
||||
}
|
||||
|
||||
if (HadAttribute<FixedUpdateAttribute>(inst.GetType()))
|
||||
{
|
||||
_listFixedUpdate.Add(inst);
|
||||
}
|
||||
}
|
||||
|
||||
public void UnRegSingleton(BaseBehaviourSingleton inst)
|
||||
{
|
||||
if (inst == null)
|
||||
{
|
||||
Log.Error($"BaseBehaviourSingleton Is Null");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Assert(_listInst.Contains(inst));
|
||||
if (_listInst.Contains(inst))
|
||||
{
|
||||
_listInst.Remove(inst);
|
||||
}
|
||||
|
||||
if (_listStart.Contains(inst))
|
||||
{
|
||||
_listStart.Remove(inst);
|
||||
}
|
||||
|
||||
if (_listUpdate.Contains(inst))
|
||||
{
|
||||
_listUpdate.Remove(inst);
|
||||
}
|
||||
|
||||
if (_listLateUpdate.Contains(inst))
|
||||
{
|
||||
_listLateUpdate.Remove(inst);
|
||||
}
|
||||
|
||||
inst.Destroy();
|
||||
inst = null;
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
var listStart = _listStart;
|
||||
var listToUpdate = _listUpdate;
|
||||
int count = listStart.Count;
|
||||
if (count > 0)
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var inst = listStart[i];
|
||||
Log.Assert(!inst.IsStart);
|
||||
|
||||
inst.IsStart = true;
|
||||
inst.Start();
|
||||
}
|
||||
|
||||
listStart.Clear();
|
||||
}
|
||||
|
||||
var listUpdateCnt = listToUpdate.Count;
|
||||
for (int i = 0; i < listUpdateCnt; i++)
|
||||
{
|
||||
var inst = listToUpdate[i];
|
||||
|
||||
TProfiler.BeginFirstSample(inst.GetType().FullName);
|
||||
inst.Update();
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnLateUpdate()
|
||||
{
|
||||
var listLateUpdate = _listLateUpdate;
|
||||
var listLateUpdateCnt = listLateUpdate.Count;
|
||||
for (int i = 0; i < listLateUpdateCnt; i++)
|
||||
{
|
||||
var inst = listLateUpdate[i];
|
||||
|
||||
TProfiler.BeginFirstSample(inst.GetType().FullName);
|
||||
inst.LateUpdate();
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnFixedUpdate()
|
||||
{
|
||||
var listFixedUpdate = _listFixedUpdate;
|
||||
var listFixedUpdateCnt = listFixedUpdate.Count;
|
||||
for (int i = 0; i < listFixedUpdateCnt; i++)
|
||||
{
|
||||
var inst = listFixedUpdate[i];
|
||||
|
||||
TProfiler.BeginFirstSample(inst.GetType().FullName);
|
||||
inst.FixedUpdate();
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
int count = _listInst.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var inst = _listInst[i];
|
||||
inst.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnApplicationPause(bool pause)
|
||||
{
|
||||
int count = _listInst.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var inst = _listInst[i];
|
||||
if (pause)
|
||||
{
|
||||
inst.OnPause();
|
||||
}
|
||||
else
|
||||
{
|
||||
inst.OnResume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDrawGizmos()
|
||||
{
|
||||
int count = _listInst.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var inst = _listInst[i];
|
||||
inst.OnDrawGizmos();
|
||||
}
|
||||
}
|
||||
|
||||
private bool HadAttribute<T>(Type type) where T : Attribute
|
||||
{
|
||||
T attribute = Attribute.GetCustomAttribute(type, typeof(T)) as T;
|
||||
return attribute != null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c0e9c1c8c9d4ce99a1c991fb62a0256
|
||||
timeCreated: 1683120460
|
17
EintooAR/Assets/GameScripts/HotFix/GameBase/GameBase.asmdef
Normal file
17
EintooAR/Assets/GameScripts/HotFix/GameBase/GameBase.asmdef
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "GameBase",
|
||||
"rootNamespace": "GameBase",
|
||||
"references": [
|
||||
"GUID:24c092aee38482f4e80715eaa8148782",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbb0d51b565003841ae81cdbaf747114
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
58
EintooAR/Assets/GameScripts/HotFix/GameBase/ILogicSys.cs
Normal file
58
EintooAR/Assets/GameScripts/HotFix/GameBase/ILogicSys.cs
Normal file
@ -0,0 +1,58 @@
|
||||
/// <summary>
|
||||
/// 定义通用的逻辑接口,统一生命期调用
|
||||
/// </summary>
|
||||
public interface ILogicSys
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化接口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool OnInit();
|
||||
|
||||
/// <summary>
|
||||
/// 销毁系统
|
||||
/// </summary>
|
||||
void OnDestroy();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化后,第一帧统一调用
|
||||
/// </summary>
|
||||
void OnStart();
|
||||
|
||||
/// <summary>
|
||||
/// 更新接口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
void OnUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// 渲染后调用
|
||||
/// </summary>
|
||||
void OnLateUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// 物理帧更新
|
||||
/// </summary>
|
||||
void OnFixedUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// 登录账号/角色时调用
|
||||
/// </summary>
|
||||
void OnRoleLogin();
|
||||
|
||||
/// <summary>
|
||||
/// 清理数据接口,切换账号/角色时调用
|
||||
/// </summary>
|
||||
void OnRoleLogout();
|
||||
|
||||
/// <summary>
|
||||
/// 绘制调试接口
|
||||
/// </summary>
|
||||
void OnDrawGizmos();
|
||||
|
||||
/// <summary>
|
||||
/// 暂停游戏
|
||||
/// </summary>
|
||||
/// <param name="pause"></param>
|
||||
void OnApplicationPause(bool pause);
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63ff6535a43f41d7ac793b8a153a37b6
|
||||
timeCreated: 1681213932
|
59
EintooAR/Assets/GameScripts/HotFix/GameBase/Singleton.cs
Normal file
59
EintooAR/Assets/GameScripts/HotFix/GameBase/Singleton.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局对象必须继承于此。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">子类类型。</typeparam>
|
||||
public abstract class Singleton<T> : ISingleton where T : Singleton<T>, new()
|
||||
{
|
||||
protected static T _instance = default(T);
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
_instance.Init();
|
||||
SingletonSystem.Retain(_instance);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValid => _instance != null;
|
||||
|
||||
protected Singleton()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
string st = new StackTrace().ToString();
|
||||
// using const string to compare simply
|
||||
if (!st.Contains("GameBase.Singleton`1[T].get_Instance"))
|
||||
{
|
||||
UnityEngine.Debug.LogError($"请必须通过Instance方法来实例化{typeof(T).FullName}类");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
protected virtual void Init()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Active()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Release()
|
||||
{
|
||||
if (_instance != null)
|
||||
{
|
||||
SingletonSystem.Release(_instance);
|
||||
_instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b68a449df312429cbb27873984ec238e
|
||||
timeCreated: 1681214042
|
@ -0,0 +1,111 @@
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局MonoBehavior必须继承于此
|
||||
/// </summary>
|
||||
/// <typeparam name="T">子类类型</typeparam>
|
||||
public class SingletonBehaviour<T> : MonoBehaviour where T : SingletonBehaviour<T>
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (CheckInstance())
|
||||
{
|
||||
OnLoad();
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckInstance()
|
||||
{
|
||||
if (this == Instance)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
Object.Destroy(gameObject);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual void OnLoad()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
if (this == _instance)
|
||||
{
|
||||
Release();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断对象是否有效
|
||||
/// </summary>
|
||||
public static bool IsValid
|
||||
{
|
||||
get
|
||||
{
|
||||
return _instance != null;
|
||||
}
|
||||
}
|
||||
|
||||
public static T Active()
|
||||
{
|
||||
return Instance;
|
||||
}
|
||||
|
||||
public static void Release()
|
||||
{
|
||||
if (_instance != null)
|
||||
{
|
||||
SingletonSystem.Release(_instance.gameObject);
|
||||
_instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实例
|
||||
/// </summary>
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
System.Type thisType = typeof(T);
|
||||
string instName = thisType.Name;
|
||||
GameObject go = SingletonSystem.GetGameObject(instName);
|
||||
if (go == null)
|
||||
{
|
||||
go = GameObject.Find($"/{instName}");
|
||||
if (go == null)
|
||||
{
|
||||
go = new GameObject(instName);
|
||||
go.transform.position = Vector3.zero;
|
||||
}
|
||||
SingletonSystem.Retain(go);
|
||||
}
|
||||
|
||||
if (go != null)
|
||||
{
|
||||
_instance = go.GetComponent<T>();
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = go.AddComponent<T>();
|
||||
}
|
||||
}
|
||||
|
||||
if (_instance == null)
|
||||
{
|
||||
Log.Error($"Can't create SingletonBehaviour<{typeof(T)}>");
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc365e281d234e61891bf9f922a0897a
|
||||
timeCreated: 1715574965
|
141
EintooAR/Assets/GameScripts/HotFix/GameBase/SingletonSystem.cs
Normal file
141
EintooAR/Assets/GameScripts/HotFix/GameBase/SingletonSystem.cs
Normal file
@ -0,0 +1,141 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
public interface ISingleton
|
||||
{
|
||||
/// <summary>
|
||||
/// 激活接口,通常用于在某个时机手动实例化
|
||||
/// </summary>
|
||||
void Active();
|
||||
|
||||
/// <summary>
|
||||
/// 释放接口
|
||||
/// </summary>
|
||||
void Release();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 框架中的全局对象与Unity场景依赖相关的DontDestroyOnLoad需要统一管理,方便重启游戏时清除工作
|
||||
/// </summary>
|
||||
public static class SingletonSystem
|
||||
{
|
||||
private static List<ISingleton> _singletons;
|
||||
private static Dictionary<string, GameObject> _gameObjects;
|
||||
|
||||
public static void Retain(ISingleton go)
|
||||
{
|
||||
if (_singletons == null)
|
||||
{
|
||||
_singletons = new List<ISingleton>();
|
||||
}
|
||||
|
||||
_singletons.Add(go);
|
||||
}
|
||||
|
||||
public static void Retain(GameObject go)
|
||||
{
|
||||
if (_gameObjects == null)
|
||||
{
|
||||
_gameObjects = new Dictionary<string, GameObject>();
|
||||
}
|
||||
|
||||
if (_gameObjects.TryAdd(go.name, go))
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
Object.DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(GameObject go)
|
||||
{
|
||||
if (_gameObjects != null && _gameObjects.ContainsKey(go.name))
|
||||
{
|
||||
_gameObjects.Remove(go.name);
|
||||
Object.Destroy(go);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(ISingleton go)
|
||||
{
|
||||
if (_singletons != null && _singletons.Contains(go))
|
||||
{
|
||||
_singletons.Remove(go);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release()
|
||||
{
|
||||
if (_gameObjects != null)
|
||||
{
|
||||
foreach (var item in _gameObjects)
|
||||
{
|
||||
Object.Destroy(item.Value);
|
||||
}
|
||||
|
||||
_gameObjects.Clear();
|
||||
}
|
||||
|
||||
if (_singletons != null)
|
||||
{
|
||||
for (int i = _singletons.Count -1; i >= 0; i--)
|
||||
{
|
||||
_singletons[i].Release();
|
||||
}
|
||||
|
||||
_singletons.Clear();
|
||||
}
|
||||
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
|
||||
public static GameObject GetGameObject(string name)
|
||||
{
|
||||
GameObject go = null;
|
||||
if (_gameObjects != null)
|
||||
{
|
||||
_gameObjects.TryGetValue(name, out go);
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
|
||||
internal static bool ContainsKey(string name)
|
||||
{
|
||||
if (_gameObjects != null)
|
||||
{
|
||||
return _gameObjects.ContainsKey(name);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void Restart()
|
||||
{
|
||||
if (Camera.main != null)
|
||||
{
|
||||
Camera.main.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
Release();
|
||||
SceneManager.LoadScene(0);
|
||||
}
|
||||
|
||||
internal static ISingleton GetSingleton(string name)
|
||||
{
|
||||
for (int i = 0; i < _singletons.Count; ++i)
|
||||
{
|
||||
if (_singletons[i].ToString() == name)
|
||||
{
|
||||
return _singletons[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ad00b596d0743a4b04591fe52087d0f
|
||||
timeCreated: 1715574577
|
8
EintooAR/Assets/GameScripts/HotFix/GameLogic.meta
Normal file
8
EintooAR/Assets/GameScripts/HotFix/GameLogic.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82f77e4cefa1ad9409f5fb774f3602bb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7955fe73e1d42724881091de935595a5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63de7566bf72a284ba558c578a56c5f3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95003e58d4f04e16a5f88713d66099e8
|
||||
timeCreated: 1743045657
|
@ -0,0 +1,11 @@
|
||||
using Sirenix.OdinInspector;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public enum EARTrackType
|
||||
{
|
||||
[LabelText("模型")]model,
|
||||
[LabelText("图片")]pic,
|
||||
[LabelText("视频")]video,
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e16fb4c5dbb34f3eaa74e6cc74fefa29
|
||||
timeCreated: 1743045683
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3dd8186a935f174baf409b070734ee6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,39 @@
|
||||
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class UISlideExtension : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
||||
{
|
||||
public Slider m_slider;
|
||||
private bool hasVibrated = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
m_slider = GetComponent<Slider>();
|
||||
}
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
if (!hasVibrated)
|
||||
{
|
||||
Log.Info("震动");
|
||||
MobileBaseUtility.VibratePhone();
|
||||
hasVibrated = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
// 重置值为0
|
||||
m_slider.value = 0f;
|
||||
|
||||
// 重置震动标志位(可选,看你是否允许再次震动)
|
||||
hasVibrated = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a4586e191b702447ab721159403019d
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5d4ab1d202d4084c9281b4fb3992a86
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,38 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TEngine;
|
||||
using System;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[Window(UILayer.UI)]
|
||||
class UIWidgetGuide : UIWidget
|
||||
{
|
||||
#region 脚本工具生成的代码
|
||||
private Button m_btnGuide;
|
||||
|
||||
public Action DestroyEvent;
|
||||
protected override void ScriptGenerator()
|
||||
{
|
||||
m_btnGuide = FindChildComponent<Button>("m_btnGuide");
|
||||
m_btnGuide.onClick.AddListener(UniTask.UnityAction(OnClickGuideBtn));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 事件
|
||||
private async UniTaskVoid OnClickGuideBtn()
|
||||
{
|
||||
Destroy();
|
||||
await UniTask.Yield();
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
DestroyEvent?.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ccf9ab43c51d1e42ac2626486b6837c
|
@ -0,0 +1,200 @@
|
||||
/*using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class BoxColliderGenerator : MonoBehaviour
|
||||
{
|
||||
void Awake()
|
||||
{
|
||||
// 获取当前物体下的所有子物体
|
||||
MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>();
|
||||
|
||||
if (meshFilters.Length == 0)
|
||||
{
|
||||
Debug.LogWarning("No MeshFilters found in children!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化一个总包围盒
|
||||
Bounds totalBounds = meshFilters[0].mesh.bounds;
|
||||
Transform firstTransform = meshFilters[0].transform;
|
||||
|
||||
// 把第一个 MeshFilter 的包围盒变换到父物体的局部坐标空间
|
||||
totalBounds = TransformBounds(totalBounds, firstTransform.localToWorldMatrix, transform.worldToLocalMatrix);
|
||||
|
||||
// 遍历所有的 MeshFilter
|
||||
foreach (var meshFilter in meshFilters)
|
||||
{
|
||||
// 获取当前 mesh 的包围盒
|
||||
Bounds meshBounds = meshFilter.mesh.bounds;
|
||||
|
||||
// 把当前包围盒变换到父物体的局部坐标空间
|
||||
meshBounds = TransformBounds(meshBounds, meshFilter.transform.localToWorldMatrix,
|
||||
transform.worldToLocalMatrix);
|
||||
|
||||
// 合并到总包围盒中
|
||||
totalBounds.Encapsulate(meshBounds);
|
||||
}
|
||||
|
||||
// 在当前物体上添加或获取 BoxCollider
|
||||
BoxCollider boxCollider = gameObject.GetComponent<BoxCollider>();
|
||||
if (boxCollider == null)
|
||||
{
|
||||
boxCollider = gameObject.AddComponent<BoxCollider>();
|
||||
}
|
||||
|
||||
// 设置 BoxCollider 的中心和大小
|
||||
boxCollider.center = totalBounds.center;
|
||||
boxCollider.size = totalBounds.size;
|
||||
|
||||
Debug.Log("BoxCollider generated!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 变换 Bounds 到新的坐标空间
|
||||
/// </summary>
|
||||
/// <param name="bounds">要变换的包围盒</param>
|
||||
/// <param name="fromMatrix">源变换矩阵</param>
|
||||
/// <param name="toMatrix">目标变换矩阵</param>
|
||||
/// <returns>变换后的包围盒</returns>
|
||||
private Bounds TransformBounds(Bounds bounds, Matrix4x4 fromMatrix, Matrix4x4 toMatrix)
|
||||
{
|
||||
// 获取包围盒的 8 个顶点
|
||||
Vector3[] corners = new Vector3[8];
|
||||
Vector3 min = bounds.min;
|
||||
Vector3 max = bounds.max;
|
||||
|
||||
corners[0] = new Vector3(min.x, min.y, min.z);
|
||||
corners[1] = new Vector3(max.x, min.y, min.z);
|
||||
corners[2] = new Vector3(min.x, max.y, min.z);
|
||||
corners[3] = new Vector3(max.x, max.y, min.z);
|
||||
corners[4] = new Vector3(min.x, min.y, max.z);
|
||||
corners[5] = new Vector3(max.x, min.y, max.z);
|
||||
corners[6] = new Vector3(min.x, max.y, max.z);
|
||||
corners[7] = new Vector3(max.x, max.y, max.z);
|
||||
|
||||
// 变换到世界坐标
|
||||
for (int i = 0; i < corners.Length; i++)
|
||||
{
|
||||
corners[i] = fromMatrix.MultiplyPoint3x4(corners[i]);
|
||||
}
|
||||
|
||||
// 再变换到目标局部坐标
|
||||
for (int i = 0; i < corners.Length; i++)
|
||||
{
|
||||
corners[i] = toMatrix.MultiplyPoint3x4(corners[i]);
|
||||
}
|
||||
|
||||
// 重新计算包围盒
|
||||
Bounds transformedBounds = new Bounds(corners[0], Vector3.zero);
|
||||
foreach (var corner in corners)
|
||||
{
|
||||
transformedBounds.Encapsulate(corner);
|
||||
}
|
||||
|
||||
return transformedBounds;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class BoxColliderGenerator : MonoBehaviour
|
||||
{
|
||||
void Awake()
|
||||
{
|
||||
// 获取当前物体下的所有子物体的 MeshFilter 和 SkinnedMeshRenderer
|
||||
MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>();
|
||||
SkinnedMeshRenderer[] skinnedMeshRenderers = GetComponentsInChildren<SkinnedMeshRenderer>();
|
||||
|
||||
if (meshFilters.Length == 0 && skinnedMeshRenderers.Length == 0)
|
||||
{
|
||||
Debug.LogWarning("No MeshFilters or SkinnedMeshRenderers found in children!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化一个总包围盒
|
||||
Bounds totalBounds = new Bounds(Vector3.zero, Vector3.zero);
|
||||
|
||||
// 处理所有 MeshFilter
|
||||
foreach (var meshFilter in meshFilters)
|
||||
{
|
||||
Bounds meshBounds = meshFilter.mesh.bounds;
|
||||
meshBounds = TransformBounds(meshBounds, meshFilter.transform.localToWorldMatrix, transform.worldToLocalMatrix);
|
||||
totalBounds.Encapsulate(meshBounds);
|
||||
}
|
||||
|
||||
// 处理所有 SkinnedMeshRenderer
|
||||
foreach (var skinnedMeshRenderer in skinnedMeshRenderers)
|
||||
{
|
||||
Bounds meshBounds = skinnedMeshRenderer.bounds;
|
||||
meshBounds = TransformBounds(meshBounds, skinnedMeshRenderer.transform.localToWorldMatrix, transform.worldToLocalMatrix);
|
||||
totalBounds.Encapsulate(meshBounds);
|
||||
}
|
||||
|
||||
// 在当前物体上添加或获取 BoxCollider
|
||||
BoxCollider boxCollider = gameObject.GetComponent<BoxCollider>();
|
||||
if (boxCollider == null)
|
||||
{
|
||||
boxCollider = gameObject.AddComponent<BoxCollider>();
|
||||
}
|
||||
|
||||
// 设置 BoxCollider 的中心和大小
|
||||
boxCollider.center = totalBounds.center;
|
||||
boxCollider.size = totalBounds.size;
|
||||
|
||||
Debug.Log("BoxCollider generated!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 变换 Bounds 到新的坐标空间
|
||||
/// </summary>
|
||||
/// <param name="bounds">要变换的包围盒</param>
|
||||
/// <param name="fromMatrix">源变换矩阵</param>
|
||||
/// <param name="toMatrix">目标变换矩阵</param>
|
||||
/// <returns>变换后的包围盒</returns>
|
||||
private Bounds TransformBounds(Bounds bounds, Matrix4x4 fromMatrix, Matrix4x4 toMatrix)
|
||||
{
|
||||
// 获取包围盒的 8 个顶点
|
||||
Vector3[] corners = new Vector3[8];
|
||||
Vector3 min = bounds.min;
|
||||
Vector3 max = bounds.max;
|
||||
|
||||
corners[0] = new Vector3(min.x, min.y, min.z);
|
||||
corners[1] = new Vector3(max.x, min.y, min.z);
|
||||
corners[2] = new Vector3(min.x, max.y, min.z);
|
||||
corners[3] = new Vector3(max.x, max.y, min.z);
|
||||
corners[4] = new Vector3(min.x, min.y, max.z);
|
||||
corners[5] = new Vector3(max.x, min.y, max.z);
|
||||
corners[6] = new Vector3(min.x, max.y, max.z);
|
||||
corners[7] = new Vector3(max.x, max.y, max.z);
|
||||
|
||||
// 变换到世界坐标
|
||||
for (int i = 0; i < corners.Length; i++)
|
||||
{
|
||||
corners[i] = fromMatrix.MultiplyPoint3x4(corners[i]);
|
||||
}
|
||||
|
||||
// 再变换到目标局部坐标
|
||||
for (int i = 0; i < corners.Length; i++)
|
||||
{
|
||||
corners[i] = toMatrix.MultiplyPoint3x4(corners[i]);
|
||||
}
|
||||
|
||||
// 重新计算包围盒
|
||||
Bounds transformedBounds = new Bounds(corners[0], Vector3.zero);
|
||||
foreach (var corner in corners)
|
||||
{
|
||||
transformedBounds.Encapsulate(corner);
|
||||
}
|
||||
|
||||
return transformedBounds;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20392c5f497a4a94dbba499689b6a284
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7d9b9b78db379746a035d7aa581352a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4797d79ff20f46798a80d142445f17a7
|
||||
timeCreated: 1743038446
|
@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[System.Serializable]
|
||||
public class CompanyData
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public int sortId; // 排序ID
|
||||
public string userCode; // 用户代码
|
||||
public string userAccount; // 用户账号
|
||||
public string userName; // 用户名称
|
||||
public string mobile; // 手机号码
|
||||
public string status; // 用户状态
|
||||
public string companyName; // 公司名称
|
||||
public string logoPath; // Logo路径
|
||||
public int industry; // 行业类型
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class CompanyAllData
|
||||
{
|
||||
public int total; // 总记录数
|
||||
public List<CompanyData> list; // 数据列表
|
||||
public int pageNum; // 当前页码
|
||||
public int pageSize; // 每页大小
|
||||
public int size; // 当前页记录数
|
||||
public int startRow; // 起始行
|
||||
public int endRow; // 结束行
|
||||
public int pages; // 总页数
|
||||
public int prePage; // 上一页
|
||||
public int nextPage; // 下一页
|
||||
public string isFirstPage; // 是否第一页
|
||||
public string isLastPage; // 是否最后一页
|
||||
public string hasPreviousPage; // 是否有上一页
|
||||
public string hasNextPage; // 是否有下一页
|
||||
public int navigatePages; // 导航页码数
|
||||
public List<int> navigatepageNums; // 所有导航页号
|
||||
public int navigateFirstPage; // 导航条上的第一页
|
||||
public int navigateLastPage; // 导航条上的最后一页
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class CompanyIndustryRoot
|
||||
{
|
||||
public int code; // 返回代码
|
||||
public string message; // 返回消息
|
||||
public CompanyAllData data; // 返回数据
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab151eda28c1568498a7232f571f1f87
|
@ -0,0 +1,259 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class JsonData
|
||||
{
|
||||
[Serializable]
|
||||
public class ExhibitionHallData
|
||||
{
|
||||
public int code;
|
||||
public string message;
|
||||
public List<ExhibitionHall> data = new List<ExhibitionHall>();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ExhibitionHall
|
||||
{
|
||||
public int id;
|
||||
public int userId;
|
||||
public string name;
|
||||
public string url; //glb url
|
||||
public string description;
|
||||
public int? thumbnailId; // 因为 thumbnailId 可能为 null, 所以用 int? (nullable 类型)
|
||||
public string thumbnailUrl; //cover url
|
||||
public string type;
|
||||
public DateTime createTime;
|
||||
public DateTime modifyTime;
|
||||
public string status;
|
||||
public string delFlag;
|
||||
public int manageId;
|
||||
public int division;
|
||||
public string category; // category 可能为 null, 所以类型为 string,但你也可以使用 nullable
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class CompanyTopData
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public int sortId; // 排序ID
|
||||
public string userCode; // 用户代码
|
||||
public string userAccount; // 用户账号
|
||||
public string userName; // 用户姓名
|
||||
public string mobile; // 用户手机号
|
||||
public string status; // 用户状态(例如0表示正常)
|
||||
public string companyName; // 公司名称
|
||||
public string logoPath; // 公司Logo路径
|
||||
public int industry; // 行业ID
|
||||
}
|
||||
|
||||
|
||||
#region 首页数据4个
|
||||
|
||||
[Serializable]
|
||||
public class IndustryAllCompanyData
|
||||
{
|
||||
public int code; // 响应码,200表示成功
|
||||
public string message; // 响应消息,例如“操作成功!”
|
||||
public ProjectIndustryCompanyData data; // 数据字段,包含分页信息
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ProjectIndustryCompanyData
|
||||
{
|
||||
public int total; // 总记录数
|
||||
public List<CompanyUnitData> list; // 数据列表,目前为空
|
||||
public int pageNum; // 当前页码
|
||||
public int pageSize; // 每页的记录数
|
||||
public int size; // 当前页的记录数
|
||||
public int startRow; // 当前页的起始行
|
||||
public int endRow; // 当前页的结束行
|
||||
public int pages; // 总页数
|
||||
public int prePage; // 上一页页码
|
||||
public int nextPage; // 下一页页码
|
||||
public bool isFirstPage; // 是否为第一页
|
||||
public bool isLastPage; // 是否为最后一页
|
||||
public bool hasPreviousPage; // 是否有上一页
|
||||
public bool hasNextPage; // 是否有下一页
|
||||
public int navigatePages; // 导航的页数
|
||||
public List<int> navigatepageNums; // 导航的页码列表
|
||||
public int navigateFirstPage; // 导航的第一页页码
|
||||
public int navigateLastPage; // 导航的最后一页页码
|
||||
}
|
||||
|
||||
|
||||
/*[Serializable]
|
||||
public class UserInfo
|
||||
{
|
||||
public UserInfoVo userInfoVo;
|
||||
public List<ProjectListVo> projectListVo;
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
[Serializable]
|
||||
public class UserInfoVo
|
||||
{
|
||||
public string userCode;
|
||||
public int memberType;
|
||||
public string companyName;
|
||||
public int industry;
|
||||
public string logoPath;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ProjectListVo
|
||||
{
|
||||
public int id;
|
||||
public int parentId;
|
||||
public int userId;
|
||||
public int? projectCoverId;
|
||||
public string projectCoverSrc;
|
||||
public string wxProjectName;
|
||||
public string wxProjectType;
|
||||
public string trackImageDescription;
|
||||
public string trackCoverSrc;
|
||||
public string trackImageSrc;
|
||||
public string trackImageMindSrc;
|
||||
public int? planeCategoryId;
|
||||
public BrochurePlaneCategoryVo brochurePlaneCategoryVo;
|
||||
public int? virtualHallId;
|
||||
public string virtualHallSrc;
|
||||
public int? virtualHumanId;
|
||||
public string virtualHumanSrc;
|
||||
public bool? isShowArnavigation;
|
||||
public bool? isShowTryOn;
|
||||
public string resName;
|
||||
public string resType;
|
||||
public int? resId;
|
||||
public string resSrc;
|
||||
public int? thumbnailId;
|
||||
public string thumbnailUrl;
|
||||
public float? positionX;
|
||||
public float? positionY;
|
||||
public float? positionZ;
|
||||
public float? scaleX;
|
||||
public float? scaleY;
|
||||
public float? scaleZ;
|
||||
public float? rotationX;
|
||||
public float? rotationY;
|
||||
public float? rotationZ;
|
||||
public string createTime;
|
||||
public string modifyTime;
|
||||
public string status;
|
||||
public string delFlag;
|
||||
public int tableType;
|
||||
public int manageId;
|
||||
public string userCode;
|
||||
public int memberType;
|
||||
public string companyName;
|
||||
public int industry;
|
||||
public string logoPath;
|
||||
public List<ProjectListVo> children;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class BrochurePlaneCategoryVo
|
||||
{
|
||||
// 根据实际情况扩展
|
||||
}
|
||||
|
||||
// 以下是子类中嵌套的 ProjectListVo 子类的定义
|
||||
[Serializable]
|
||||
public class ChildProjectListVo
|
||||
{
|
||||
public int id;
|
||||
public int parentId;
|
||||
public int userId;
|
||||
public string projectName;
|
||||
public string projectDescription;
|
||||
public int? projectCoverId;
|
||||
public string projectCoverSrc;
|
||||
public int wxLimit;
|
||||
public string wxProjectName;
|
||||
public string wxProjectType;
|
||||
public int resLimit;
|
||||
public string trackImageDescription;
|
||||
public int? trackCoverId;
|
||||
public string trackCoverSrc;
|
||||
public int? trackImageId;
|
||||
public string trackImageSrc;
|
||||
public string trackImageMindSrc;
|
||||
public int? planeCategoryId;
|
||||
public BrochurePlaneCategoryVo brochurePlaneCategoryVo;
|
||||
public int? virtualHallId;
|
||||
public string virtualHallSrc;
|
||||
public int? virtualHumanId;
|
||||
public string virtualHumanSrc;
|
||||
public bool? isShowArnavigation;
|
||||
public bool? isShowTryOn;
|
||||
public string resName;
|
||||
public string resType;
|
||||
public int? resId;
|
||||
public string resSrc;
|
||||
public int? thumbnailId;
|
||||
public string thumbnailUrl;
|
||||
public float? positionX;
|
||||
public float? positionY;
|
||||
public float? positionZ;
|
||||
public float? scaleX;
|
||||
public float? scaleY;
|
||||
public float? scaleZ;
|
||||
public float? rotationX;
|
||||
public float? rotationY;
|
||||
public float? rotationZ;
|
||||
public string createTime;
|
||||
public string modifyTime;
|
||||
public string status;
|
||||
public string delFlag;
|
||||
public int tableType;
|
||||
public int manageId;
|
||||
public List<ChildProjectListVo> children;
|
||||
}
|
||||
|
||||
#endregion
|
||||
*/
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查询公司所有数据
|
||||
|
||||
[Serializable]
|
||||
public class QueryAllCompanyData
|
||||
{
|
||||
public int code;
|
||||
public string message;
|
||||
public List<QueryCompanyData> data;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class QueryCompanyData
|
||||
{
|
||||
public int userId;
|
||||
public int? sortId; // 因为 sortId 有可能为 null,所以使用 int? 表示可空类型
|
||||
public string userCode;
|
||||
public string userAccount;
|
||||
public string userName;
|
||||
public string mobile;
|
||||
public string status;
|
||||
public string companyName;
|
||||
public string logoPath;
|
||||
public int industry;
|
||||
public Sprite sprite;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2e018543e8272c40b939a827106a859
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[Serializable]
|
||||
public class ProjectData
|
||||
{
|
||||
|
||||
public ProjectType _currentProjectType;
|
||||
public string _rootName;
|
||||
public string _companyName;
|
||||
|
||||
[Title("Yoo Asset 加载封面加载名称 或者url")]
|
||||
//public string _coverAddressNameYoo;
|
||||
public string _coverAddressNameUrl;
|
||||
|
||||
//public Sprite _coverImageYoo;
|
||||
|
||||
[Title("AR Scene Data")]
|
||||
public string arSceneName;
|
||||
|
||||
[Title("AR AssetBundle Name")] public List<ARModelData> List_arModelData = new List<ARModelData>();
|
||||
//public List<ARModelData> List_arTrackData = new List<ARModelData>();
|
||||
[Title("AR AssetBundle Name")] public List<ARVirtualHUmanModelData> List_arHumanModelData = new List<ARVirtualHUmanModelData>();
|
||||
public List<ARTrackData> List_arTrackData = new List<ARTrackData>();
|
||||
|
||||
[Title("Virtual Show Room in AssetBundle sceneName")]
|
||||
public List<SceneData> list_virtualShowRoomScenesName = new List<SceneData>();
|
||||
}
|
||||
public enum ProjectType
|
||||
{
|
||||
wxVirtualHall,
|
||||
wxVirtualHumans,
|
||||
wxPlane,
|
||||
wxTrack
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67cf97d83a449894b86da9e64d83d88f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[Serializable]
|
||||
public class SceneData
|
||||
{
|
||||
public string _sceneAddressName = "scene_vs_Room";
|
||||
//public string _sceneCoverName;
|
||||
|
||||
public string _sceneglbhttpName;
|
||||
public string _sceneCoverhttpName ;
|
||||
//public Sprite _coverSprite;
|
||||
public List<PlayerData> list_players = new List<PlayerData>();
|
||||
//public
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ARModelData
|
||||
{
|
||||
public string _glbUrl;
|
||||
public string _modelName;
|
||||
public string _coverUrl;
|
||||
public string _videoUrl;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ARVirtualHUmanModelData
|
||||
{
|
||||
|
||||
public string _virtualHumanglbUrl;
|
||||
public string _virtualHumanglbCoverUrl;
|
||||
|
||||
public string _glbUrl;
|
||||
public string _modelName;
|
||||
public string _coverUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class PlayerData
|
||||
{
|
||||
public string _playerAddressName;
|
||||
public string _playerCoverAddressName;
|
||||
//public string _playerAddressName;
|
||||
}
|
||||
|
||||
|
||||
public class ProjectToSceneSavedData
|
||||
{
|
||||
public Type _rootUIWindowType = null;
|
||||
public ProjectData _projectData = new ProjectData();
|
||||
public SceneData _sceneData = new SceneData();
|
||||
public PlayerData _playerData = new PlayerData();
|
||||
public string _SelectsceneAddressName = "";
|
||||
public string _SelectcharacterAddressName = "";
|
||||
public string searchStr = string.Empty;
|
||||
|
||||
public EARModel m_earModel = EARModel.None;
|
||||
public ProjectToSceneSavedData(Type rootUIWindowType =null,ProjectData projectData=null, SceneData sceneData=null,PlayerData playerData=null,string selectsceneAddressName=null, string selectcharacterAddressName=null)
|
||||
{
|
||||
_rootUIWindowType = rootUIWindowType;
|
||||
_projectData = projectData;
|
||||
_sceneData = sceneData;
|
||||
_playerData = playerData;
|
||||
_SelectcharacterAddressName = selectcharacterAddressName;
|
||||
_SelectsceneAddressName = selectsceneAddressName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: baa89517b8a227447849adf32217741b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a69d4a0754f2468087ff28a7f4e97835
|
||||
timeCreated: 1743046032
|
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[Serializable]
|
||||
public class ARTrackData
|
||||
{
|
||||
public string trackImageUrl; //识别图
|
||||
public List<ARTrackChildrenData> trackChildren = new List<ARTrackChildrenData>(); //识别显示的子物体
|
||||
}
|
||||
[Serializable]
|
||||
public class ARTrackChildrenData
|
||||
{
|
||||
public EARTrackType trackResType; //识别类型
|
||||
public string name; //名称
|
||||
public string showGlbModelUrl; // 识别现实的模型
|
||||
public string showVideoUrl;// 识别现实的视频
|
||||
public string showImageUrl;// 识别现实的图片
|
||||
|
||||
public Vector3 position; //位置
|
||||
public Quaternion rotation; //旋转
|
||||
public Vector3 scale; //缩放
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61440eef1f6f4a38aec01b4b7b772ccd
|
||||
timeCreated: 1743046041
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e26c61c9993641e68f777d06798d1e2c
|
||||
timeCreated: 1743038440
|
@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
public class CompanyConfigDataItem
|
||||
{
|
||||
public int userId; // 用户ID
|
||||
public int sortId; // 排序ID
|
||||
public string userCode; // 用户代码
|
||||
public string userAccount; // 用户账号
|
||||
public string userName; // 用户名称
|
||||
public string mobile; // 手机号码
|
||||
public string status; // 状态
|
||||
public string companyName; // 公司名称
|
||||
public string logoPath; // 标志路径
|
||||
public int industry; // 行业
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class CompanyConfigRoot
|
||||
{
|
||||
public int code; // 状态码
|
||||
public string message; // 消息
|
||||
public List<CompanyConfigDataItem> data; // 数据列表
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ade4a60ad124099b8301ba120ae0616
|
||||
timeCreated: 1743041394
|
@ -0,0 +1,176 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectConfigUserInfoVo
|
||||
{
|
||||
public string userCode;// 用户代码
|
||||
public int memberType;// 会员类型
|
||||
public string companyName;// 基础案例
|
||||
public int industry;// 行业
|
||||
public string logoPath;// 标志路径
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectConfigChildrenItem
|
||||
{
|
||||
public int id;// ID
|
||||
public int parentId;// 父ID
|
||||
public int userId;// 用户ID
|
||||
public string projectName;// 项目名称
|
||||
public string projectDescription;// 项目描述
|
||||
public string projectCoverId;// 项目封面ID
|
||||
public string projectCoverSrc;// 项目封面源
|
||||
public string wxLimit;// 微信限制
|
||||
public string wxProjectName;// 微信项目名称
|
||||
public string wxProjectType;// 微信项目类型
|
||||
public string resLimit;// 资源限制
|
||||
public string trackImageDescription;// 跟踪图像描述
|
||||
public string trackCoverId;// 跟踪封面ID
|
||||
public string trackCoverSrc;// 跟踪封面源
|
||||
public string trackImageId;// 跟踪图像ID
|
||||
public string trackImageSrc;// 跟踪图像源
|
||||
public string trackImageMindSrc;// 跟踪图像思维源
|
||||
public string planeCategoryId;// 平面类别ID
|
||||
public string brochurePlaneCategoryVo;// 宣传册平面类别Vo
|
||||
public string virtualHallId;// 虚拟大厅ID
|
||||
public string virtualHallSrc;// 虚拟大厅源
|
||||
public string virtualHumanId;// 虚拟人物ID
|
||||
public string virtualHumanSrc;// 虚拟人物源
|
||||
public string isShowArnavigation;// 是否显示AR导航
|
||||
public string isShowTryOn;// 是否显示试穿
|
||||
public string resName;// 资源名称
|
||||
public string resType;// 资源类型
|
||||
public string resId;// 资源ID
|
||||
public string resSrc;// 资源源
|
||||
public string thumbnailId;// 缩略图ID
|
||||
public string thumbnailUrl;// 缩略图URL
|
||||
public string location;// 位置
|
||||
public string positionX;// X位置
|
||||
public string positionY;// Y位置
|
||||
public string positionZ;// Z位置
|
||||
public string scaleX;// X缩放
|
||||
public string scaleY;// Y缩放
|
||||
public string scaleZ;// Z缩放
|
||||
public string rotationX;// X旋转
|
||||
public string rotationY;// Y旋转
|
||||
public string rotationZ;// Z旋转
|
||||
public string createTime;// 创建时间
|
||||
public string modifyTime;// 修改时间
|
||||
public string status;// 状态
|
||||
public string delFlag;// 删除标志
|
||||
public int tableType;// 表类型
|
||||
public int manageId;// 管理ID
|
||||
public string rotationStatus;// 旋转状态
|
||||
public string enlargeStatus;// 放大状态
|
||||
public string throbStatus;// 跳动状态
|
||||
public List<string> children;// 子项
|
||||
public List<string> childrenGroupedByPlaneCategoryParentPathVos;// 按平面类别父路径分组的子项Vos
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectChildrenGroupedByPlaneCategoryId
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectConfigListVoItem
|
||||
{
|
||||
public int id;// ID
|
||||
public int parentId;// 父ID
|
||||
public int userId;// 用户ID
|
||||
public string projectDescription;// 项目描述
|
||||
public string projectCoverId;// 项目封面ID
|
||||
public string projectCoverSrc;// 项目封面源
|
||||
public string wxProjectName;// 霜降
|
||||
public string wxProjectType;// 微信项目类型
|
||||
public string trackImageDescription;// 跟踪图像描述
|
||||
public string trackCoverSrc;// 跟踪封面源
|
||||
public string trackImageSrc;// 跟踪图像源
|
||||
public string trackImageMindSrc;// 跟踪图像思维源
|
||||
public string planeCategoryId;// 平面类别ID
|
||||
public string brochurePlaneCategoryVo;// 宣传册平面类别Vo
|
||||
public string virtualHallId;// 虚拟大厅ID
|
||||
public string virtualHallSrc;// 虚拟大厅源
|
||||
public string virtualHumanId;// 虚拟人物ID
|
||||
public string virtualHumanSrc;// 虚拟人物源
|
||||
public string isShowArnavigation;// 是否显示AR导航
|
||||
public string isShowTryOn;// 是否显示试穿
|
||||
public string resName;// 资源名称
|
||||
public string resType;// 资源类型
|
||||
public string resId;// 资源ID
|
||||
public string resSrc;// 资源源
|
||||
public string thumbnailId;// 缩略图ID
|
||||
public string thumbnailUrl;// 缩略图URL
|
||||
public string resLimit;// 资源限制
|
||||
public string location;// 位置
|
||||
public string positionX;// X位置
|
||||
public string positionY;// Y位置
|
||||
public string positionZ;// Z位置
|
||||
public string scaleX;// X缩放
|
||||
public string scaleY;// Y缩放
|
||||
public string scaleZ;// Z缩放
|
||||
public string rotationX;// X旋转
|
||||
public string rotationY;// Y旋转
|
||||
public string rotationZ;// Z旋转
|
||||
public string createTime;// 创建时间
|
||||
public string modifyTime;// 修改时间
|
||||
public string status;// 状态
|
||||
public string delFlag;// 删除标志
|
||||
public int tableType;// 表类型
|
||||
public int manageId;// 管理ID
|
||||
public string userCode;// 用户代码
|
||||
public int memberType;// 会员类型
|
||||
public string companyName;// 基础案例
|
||||
public int industry;// 行业
|
||||
public string logoPath;// 标志路径
|
||||
public List<ProjectConfigChildrenItem> children;// 子项
|
||||
public ProjectChildrenGroupedByPlaneCategoryId childrenGroupedByPlaneCategoryId;// 按平面类别ID分组的子项
|
||||
public string groupName;// 组名
|
||||
public string showRes;// 显示资源
|
||||
public List<string> childrenGroupedByPlaneCategoryParentPathVos;// 按平面类别父路径分组的子项Vos
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectConfigDataListItem
|
||||
{
|
||||
public ProjectConfigUserInfoVo userInfoVo;// 用户信息Vo
|
||||
public List<ProjectConfigListVoItem> projectListVo;// 项目列表Vo
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectConfigData
|
||||
{
|
||||
public int total;// 总数
|
||||
public List<ProjectConfigDataListItem> list;// 列表
|
||||
public int pageNum;// 页码
|
||||
public int pageSize;// 页大小
|
||||
public int size;// 大小
|
||||
public int startRow;// 起始行
|
||||
public int endRow;// 结束行
|
||||
public int pages;// 页数
|
||||
public int prePage;// 前一页
|
||||
public int nextPage;// 下一页
|
||||
public string isFirstPage;// 是否第一页
|
||||
public string isLastPage;// 是否最后一页
|
||||
public string hasPreviousPage;// 是否有前一页
|
||||
public string hasNextPage;// 是否有下一页
|
||||
public int navigatePages;// 导航页数
|
||||
public List<int> navigatepageNums;// 导航页码数组
|
||||
public int navigateFirstPage;// 导航第一页
|
||||
public int navigateLastPage;// 导航最后一页
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ProjectConfigRoot
|
||||
{
|
||||
public int code;// 代码
|
||||
public string message;// 操作成功!
|
||||
public ProjectConfigData data;// 数据
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56016cb536b54273b59e79bd966a2538
|
||||
timeCreated: 1742981538
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33805700c367ede48908889e8492c787
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e5085619dc0c7441840c65a95391d7f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class ARRuntimeData
|
||||
{
|
||||
public static List<string> m_listCompanyUseCode = new List<string>();
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be0d0baa7ee0f7447b002382fa9e9296
|
@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class ARTrackSingleImageRuntimeData
|
||||
{
|
||||
public string _key;
|
||||
public Texture2D _texture;
|
||||
|
||||
public List<GameObject> _models = new List<GameObject>();
|
||||
public List<GameObject> _texs = new List<GameObject>();
|
||||
|
||||
public List<string> _videos = new List<string>();
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20ad68895d3a428d8cea0af7304e7c3c
|
||||
timeCreated: 1743127408
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb549632e694ca947b80a88d598c8271
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eaca11d3277b88845908722d56c674d0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,50 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Video;
|
||||
using UnityEngine.XR.ARSubsystems;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
public class ImageTrackData
|
||||
{
|
||||
[SerializeField, Tooltip("The source texture for the image. Must be marked as readable.")]
|
||||
Texture2D m_Texture;
|
||||
|
||||
public Texture2D Texture
|
||||
{
|
||||
get => m_Texture;
|
||||
set => m_Texture = value;
|
||||
}
|
||||
|
||||
[SerializeField, Tooltip("The name for this image.")]
|
||||
string m_Name;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => m_Name;
|
||||
set => m_Name = value;
|
||||
}
|
||||
|
||||
[SerializeField, Tooltip("The width, in meters, of the image in the real world.")]
|
||||
float m_Width;
|
||||
|
||||
public float Width
|
||||
{
|
||||
get => m_Width;
|
||||
set => m_Width = value;
|
||||
}
|
||||
|
||||
public AddReferenceImageJobState jobState { get; set; }
|
||||
public GameObject m_trackModel;
|
||||
//public string m_videourl;
|
||||
public GameObject TrackModel
|
||||
{
|
||||
get => m_trackModel;
|
||||
set => m_trackModel = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 174ba1b0ff4f908449eda2f9019dc482
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[System.Serializable]
|
||||
public class UserInfoVo
|
||||
{
|
||||
public string userCode ;
|
||||
public int memberType ;
|
||||
public string companyName ;
|
||||
public int industry ;
|
||||
public string logoPath ;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class Children
|
||||
{
|
||||
public int id ;
|
||||
public int parentId ;
|
||||
public int userId ;
|
||||
public string projectName ;
|
||||
public string projectDescription ;
|
||||
public string projectCoverId ;
|
||||
public string projectCoverSrc ;
|
||||
public string wxLimit ;
|
||||
public string wxProjectName ;
|
||||
public string wxProjectType ;
|
||||
public string resLimit ;
|
||||
public string trackImageDescription ;
|
||||
public string trackCoverId ;
|
||||
public string trackCoverSrc ;
|
||||
public string trackImageId ;
|
||||
public string trackImageSrc ;
|
||||
public string trackImageMindSrc ;
|
||||
public string planeCategoryId ;
|
||||
public string brochurePlaneCategoryVo ;
|
||||
public string virtualHallId ;
|
||||
public string virtualHallSrc ;
|
||||
public string virtualHumanId ;
|
||||
public string virtualHumanSrc ;
|
||||
public string isShowArnavigation ;
|
||||
public int isShowTryOn ;
|
||||
public string resName ;
|
||||
public string resType ;
|
||||
public string resId ;
|
||||
public string resSrc ;
|
||||
public string thumbnailId ;
|
||||
public string thumbnailUrl ;
|
||||
public string location ;
|
||||
public string positionX ;
|
||||
public string positionY ;
|
||||
public string positionZ ;
|
||||
public string scaleX ;
|
||||
public string scaleY ;
|
||||
public string scaleZ ;
|
||||
public string rotationX ;
|
||||
public string rotationY ;
|
||||
public string rotationZ ;
|
||||
public DateTime createTime ;
|
||||
public DateTime modifyTime ;
|
||||
public string status ;
|
||||
public string delFlag ;
|
||||
public int tableType ;
|
||||
public int manageId ;
|
||||
public string userCode ;
|
||||
public int memberType ;
|
||||
public string companyName ;
|
||||
public int industry ;
|
||||
public string logoPath ;
|
||||
public List<string> children ;
|
||||
public List<string> childrenGroupedByPlaneCategoryParentPathVos ;
|
||||
}
|
||||
[System.Serializable]
|
||||
public class ProjectListVo
|
||||
{
|
||||
public int id ;
|
||||
public int parentId ;
|
||||
public int userId ;
|
||||
public string projectCoverId ;
|
||||
public string projectCoverSrc ;
|
||||
public string wxProjectName ;
|
||||
public string wxProjectType ;
|
||||
public string trackImageDescription ;
|
||||
public string trackCoverSrc ;
|
||||
public string trackImageSrc ;
|
||||
public string trackImageMindSrc ;
|
||||
public string planeCategoryId ;
|
||||
public string brochurePlaneCategoryVo ;
|
||||
public string virtualHallId ;
|
||||
public string virtualHallSrc ;
|
||||
public string virtualHumanId ;
|
||||
public string virtualHumanSrc ;
|
||||
public string isShowArnavigation ;
|
||||
public int isShowTryOn ;
|
||||
public string resName ;
|
||||
public string resType ;
|
||||
public string resId ;
|
||||
public string resSrc ;
|
||||
public string thumbnailId ;
|
||||
public string thumbnailUrl ;
|
||||
public string resLimit ;
|
||||
public string location ;
|
||||
public string positionX ;
|
||||
public string positionY ;
|
||||
public string positionZ ;
|
||||
public string scaleX ;
|
||||
public string scaleY ;
|
||||
public string scaleZ ;
|
||||
public string rotationX ;
|
||||
public string rotationY ;
|
||||
public string rotationZ ;
|
||||
public DateTime createTime ;
|
||||
public DateTime modifyTime ;
|
||||
public string status ;
|
||||
public string delFlag ;
|
||||
public int tableType ;
|
||||
public int manageId ;
|
||||
public string userCode ;
|
||||
public int memberType ;
|
||||
public string companyName ;
|
||||
public int industry ;
|
||||
public string logoPath ;
|
||||
public List<Children> children ;
|
||||
public ChildrenGroupedByPlaneCategoryId childrenGroupedByPlaneCategoryId ;
|
||||
public string groupName ;
|
||||
public string showRes ;
|
||||
public List<string> childrenGroupedByPlaneCategoryParentPathVos ;
|
||||
}
|
||||
[System.Serializable]
|
||||
public class ChildrenGroupedByPlaneCategoryId
|
||||
{
|
||||
// 暂无字段定义
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class CompanyUnitData
|
||||
{
|
||||
public UserInfoVo userInfoVo ;
|
||||
public List<ProjectListVo> projectListVo ;
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class CompanyUnitRoot
|
||||
{
|
||||
public int code ;
|
||||
public string message ;
|
||||
public List<CompanyUnitData> data ;
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9615a90ce284d95a9067a981f3e6fec
|
||||
timeCreated: 1732168225
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa1a83adf5f24bc1af7b1584858d2b28
|
||||
timeCreated: 1733216300
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[Serializable]
|
||||
public class VueUpdatePlayerPosition
|
||||
{
|
||||
public string type;
|
||||
public float x;
|
||||
public float y;
|
||||
public VueUpdatePlayerPosition()
|
||||
{
|
||||
type = this.GetType().Name;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbb04d8ee6bb4ba1b3719792978c655b
|
||||
timeCreated: 1733216321
|
@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
public class SearchData
|
||||
{
|
||||
public List<string> list = new List<string>();
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0677032bbb536964785b5759a8c43d07
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6318020a7afed64bbdca6fe5a246c5e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d06cd50d73e47e7adc9c546b040d4f9
|
||||
timeCreated: 1737599092
|
@ -0,0 +1,9 @@
|
||||
namespace GameLogic
|
||||
{
|
||||
public enum EARModel
|
||||
{
|
||||
None,
|
||||
Normal,
|
||||
Teacher
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b9139e46acc4542977cb17b0c79d163
|
||||
timeCreated: 1737599220
|
@ -0,0 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public enum PlayerSex
|
||||
{
|
||||
man,
|
||||
female
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48bcdca6ae137774ca8a8e7eef3816bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37e9cdd15cec486e8c7adabd992e93d7
|
||||
timeCreated: 1731389122
|
@ -0,0 +1,9 @@
|
||||
namespace GameLogic.UI
|
||||
{
|
||||
public enum EUISelectBottom
|
||||
{
|
||||
Search,
|
||||
Main,
|
||||
User
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84dc20ed143b46b7bf53d62a73a71b6b
|
||||
timeCreated: 1731389136
|
@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class GameObjectFactory
|
||||
{
|
||||
|
||||
public static void CreateDeviceOrientationGo(Transform parent = null,OrientationState orientationState = OrientationState.Auto)
|
||||
{
|
||||
GameObject deviceOrientationGo = new GameObject("DeviceOrientation");
|
||||
if (parent != null)
|
||||
{
|
||||
deviceOrientationGo.transform.SetParent(parent);
|
||||
}
|
||||
var scrennOri = deviceOrientationGo.AddComponent<ScreenOrientation>();
|
||||
scrennOri.SetScreenOrientation(orientationState);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06bc100d51634f7f920ae0088744af16
|
||||
timeCreated: 1725863024
|
@ -0,0 +1,27 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using TEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class SceneModuleSystem
|
||||
{
|
||||
public static async UniTask LoadAsyncSceneInProject(this SceneModule sceneModule, string sceneName)
|
||||
{
|
||||
// 检查场景是否已经加载
|
||||
var scene = SceneManager.GetSceneByName(sceneName);
|
||||
|
||||
// 如果场景无效,异步加载场景
|
||||
if (!scene.IsValid())
|
||||
{
|
||||
await SceneManager.LoadSceneAsync(sceneName).ToUniTask();
|
||||
Log.Info($"Scene '{sceneName}' loaded successfully.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"Scene '{sceneName}' is already loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74d65e1e103ccc94b965b785c1cf1c08
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93dc511b2a878c142bbe4c08faf249bb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec757220fbe222345a92399b78939cb7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,73 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Video;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class UIWorldVideoActor : MonoBehaviour
|
||||
{
|
||||
public VideoPlayer m_videoPlayer;
|
||||
public RawImage m_rawImage;
|
||||
|
||||
public RenderTexture m_renderTexture;
|
||||
public Canvas m_canvas;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
m_videoPlayer = GetComponentInChildren<VideoPlayer>();
|
||||
m_rawImage = GetComponentInChildren<RawImage>();
|
||||
m_renderTexture = new RenderTexture(1920, 1080, 24);
|
||||
m_rawImage.texture = m_renderTexture;
|
||||
m_videoPlayer.targetTexture = m_renderTexture;
|
||||
m_canvas = GetComponentInParent<Canvas>();
|
||||
m_canvas.worldCamera = Camera.main;
|
||||
}
|
||||
|
||||
public void SetVideoUrl(string url)
|
||||
{
|
||||
m_videoPlayer.source = VideoSource.Url;
|
||||
m_videoPlayer.url = url;
|
||||
|
||||
// 添加准备完成的回调
|
||||
m_videoPlayer.prepareCompleted += OnVideoPrepared;
|
||||
m_videoPlayer.Prepare();
|
||||
m_videoPlayer.isLooping = true;
|
||||
m_videoPlayer.waitForFirstFrame = true;
|
||||
m_videoPlayer.SetDirectAudioVolume(0, 0f);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
m_videoPlayer.SetDirectAudioVolume(0, 1.0f);
|
||||
}
|
||||
void OnDisable()
|
||||
{
|
||||
m_videoPlayer.SetDirectAudioVolume(0, 0f);
|
||||
}
|
||||
private void OnVideoPrepared(VideoPlayer player)
|
||||
{
|
||||
// 获取视频的实际尺寸
|
||||
uint videoWidth = player.width;
|
||||
uint videoHeight = player.height;
|
||||
|
||||
// 释放旧的RenderTexture
|
||||
if (m_renderTexture != null)
|
||||
{
|
||||
m_renderTexture.Release();
|
||||
Destroy(m_renderTexture);
|
||||
}
|
||||
|
||||
// 创建新的与视频尺寸相匹配的RenderTexture
|
||||
m_renderTexture = new RenderTexture((int)videoWidth, (int)videoHeight, 24);
|
||||
m_rawImage.texture = m_renderTexture;
|
||||
m_videoPlayer.targetTexture = m_renderTexture;
|
||||
|
||||
// 开始播放视频
|
||||
m_videoPlayer.Play();
|
||||
|
||||
// 移除回调,避免内存泄漏
|
||||
m_videoPlayer.prepareCompleted -= OnVideoPrepared;
|
||||
m_canvas.GetComponent<RectTransform>().sizeDelta = new Vector2(videoWidth, videoHeight)*0.01f;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65d6881f7fdccc146a3db7286ac7dec2
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0d563a829cd2134788d8fc3f4e869e0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,177 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using HighlightPlus;
|
||||
using Lightbug.Utilities;
|
||||
using UnityEngine;
|
||||
using Piglet;
|
||||
using Sirenix.OdinInspector;
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class GltfImporterController : MonoBehaviorSingleton<GltfImporterController>
|
||||
{
|
||||
private GltfImportTask _taskimporter;
|
||||
public string _glburl;
|
||||
|
||||
//public MB3_MeshBaker m_meshBaker;
|
||||
[ShowInInspector] public Dictionary<string, GameObject> m_glbPlaceDict = new Dictionary<string, GameObject>();
|
||||
|
||||
public EARModel m_earModeType;
|
||||
|
||||
public override async void Start()
|
||||
{
|
||||
base.Start();
|
||||
if (m_earModeType == EARModel.Teacher)
|
||||
{
|
||||
var modelUrl = "https://arp3.arsnowslide.com/487018439876497408/tutu.glb?v=1";
|
||||
var videoUrl = "https://arp3.arsnowslide.com/320339571958276096/arkit.mp4";
|
||||
LoadGltf(modelUrl);
|
||||
}
|
||||
|
||||
}
|
||||
public override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
if (_taskimporter != null)
|
||||
{
|
||||
_taskimporter.OnProgress -= OnProgress;
|
||||
_taskimporter.OnCompleted -= OnCompleted;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region 加载场景glb
|
||||
public async UniTask<GameObject> LoadGlb(string glburl = "")
|
||||
{
|
||||
if (string.IsNullOrEmpty(glburl))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// 如果字典中已经存在该模型,直接返回
|
||||
if (m_glbPlaceDict.TryGetValue(glburl, out GameObject existingModel))
|
||||
{
|
||||
return existingModel;
|
||||
}
|
||||
|
||||
GameObject loadedObject = null;
|
||||
var tcs = new UniTaskCompletionSource<GameObject>();
|
||||
|
||||
_taskimporter = RuntimeGltfImporter.GetImportTask(glburl);
|
||||
_taskimporter.OnProgress = OnProgress;
|
||||
_taskimporter.OnCompleted = (obj) =>
|
||||
{
|
||||
loadedObject = obj;
|
||||
if (!m_glbPlaceDict.ContainsKey(glburl))
|
||||
{
|
||||
m_glbPlaceDict.Add(glburl, obj);
|
||||
}
|
||||
tcs.TrySetResult(obj);
|
||||
};
|
||||
|
||||
await _taskimporter.ToUniTask(this);
|
||||
await tcs.Task; // 等待OnCompleted回调完成
|
||||
|
||||
return loadedObject;
|
||||
}
|
||||
|
||||
public async UniTask<int> LoadGltf(string glburl = "")
|
||||
{
|
||||
//glburl = "https://arp3.arsnowslide.com/eintoo/zt/zhanwei10.glb";
|
||||
_glburl = glburl;
|
||||
if (_glburl != null && _glburl.Length>0)
|
||||
{
|
||||
_taskimporter = RuntimeGltfImporter.GetImportTask(_glburl);
|
||||
_taskimporter.OnProgress = OnProgress;
|
||||
_taskimporter.OnCompleted = OnCompleted;
|
||||
await _taskimporter.ToUniTask(this);
|
||||
|
||||
return ErrorCode.Scuccess;
|
||||
}
|
||||
return ErrorCode.Failed;
|
||||
}
|
||||
public async UniTask<int> LoadGltfToDict(string glburl = "",string videoURL = null)
|
||||
{
|
||||
//glburl = "https://arp3.arsnowslide.com/eintoo/zt/zhanwei10.glb";
|
||||
_glburl = glburl;
|
||||
if (_glburl != null && _glburl.Length>0)
|
||||
{
|
||||
_taskimporter = RuntimeGltfImporter.GetImportTask(_glburl);
|
||||
_taskimporter.OnProgress = OnProgress;
|
||||
_taskimporter.OnCompleted = (obj) =>
|
||||
{
|
||||
if (!m_glbPlaceDict.ContainsKey(glburl))
|
||||
{
|
||||
var entityARModel = obj.AddComponent<EntityARModel>();
|
||||
if (videoURL !=null && videoURL.Length >0)
|
||||
{
|
||||
entityARModel.SetUpVideo(videoURL);
|
||||
}
|
||||
|
||||
obj.transform.GetOrAddComponent<BoxColliderGenerator>();
|
||||
var highlightEffect = obj.AddComponent<HighlightEffect>();
|
||||
|
||||
highlightEffect.outlineColor = Color.white;
|
||||
highlightEffect.outlineWidth = 0.4f;
|
||||
highlightEffect.glow = 1.3f;
|
||||
highlightEffect.glowHQColor = new Color(0.19f, 0.36f, 1, 1);
|
||||
|
||||
obj.gameObject.SetActive(false);
|
||||
m_glbPlaceDict.Add(glburl,obj);
|
||||
}
|
||||
};
|
||||
await _taskimporter.ToUniTask(this);
|
||||
|
||||
return ErrorCode.Scuccess;
|
||||
}
|
||||
return ErrorCode.Failed;
|
||||
}
|
||||
public bool isGroundGo=false;
|
||||
private void OnCompleted(GameObject importedmodel)
|
||||
{
|
||||
var entityARModel = importedmodel.AddComponent<EntityARModel>();
|
||||
|
||||
|
||||
|
||||
if (importedmodel!=null)
|
||||
{
|
||||
importedmodel.name = "sceneGo";
|
||||
importedmodel.transform.position = new Vector3(0, 100, 0);
|
||||
if (importedmodel.transform.childCount > 0)
|
||||
{
|
||||
for (int i = 0; i < importedmodel.transform.childCount; i++)
|
||||
{
|
||||
var childGo = importedmodel.transform.GetChild(i);
|
||||
if (childGo.position.y >-1f && childGo.position.y < 1f &&!isGroundGo)
|
||||
{
|
||||
childGo.name = "Ground";
|
||||
isGroundGo = true;
|
||||
}
|
||||
// childGo.name = i.ToString();
|
||||
MeshCollider meshCollider = childGo.gameObject.AddComponent<MeshCollider>();
|
||||
// AdjustBoxColliderToFitModel(childGo.gameObject, boxCollider);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnProgress(GltfImportStep step, int completed, int total)
|
||||
{
|
||||
float percentage = (completed / (float) total) * 100.0f;
|
||||
Debug.Log(percentage);
|
||||
GameEvent.Send(LoadEventDefine.UpdateSceneProgress,percentage);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public GameObject GetGlbPlace(string glburl)
|
||||
{
|
||||
return m_glbPlaceDict.GetValueOrDefault(glburl);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d613dacf0112054ea1df4465207867a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d845c805356d1340a9fe1aec2556c6f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class ARBrochureHomeEventDefine
|
||||
{
|
||||
public static readonly int LoadARSceneProjectExample = RuntimeId.ToRuntimeId("ARBrochureHomeEventDefine.LoadARSceneProjectExample");
|
||||
public static readonly int UpdateSceneAndSetting = RuntimeId.ToRuntimeId("AREventDefine.UpdateSceneAndSetting");
|
||||
public static readonly int UpdateSelectSceneAndCharacterSetting = RuntimeId.ToRuntimeId("AREventDefine.UpdateSceneAndSetting");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82bc53704d7a95148b141c1d420b0a4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class AREventDefine
|
||||
{
|
||||
public static readonly int PlacedARModel = RuntimeId.ToRuntimeId("AREventDefine.PlacedARModel");
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f70cf0565d6ad148946f40b924d5d2f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class ActorEventDefine
|
||||
{
|
||||
public static readonly int PlayerMove = RuntimeId.ToRuntimeId("ActorEventDefine.PlayerMove");
|
||||
public static readonly int PlayerCameraRotation= RuntimeId.ToRuntimeId("ActorEventDefine.PlayerCameraRotation");
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f0ef98bfaff2c046b15c142cdd9fa84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class DownlandEventDefined
|
||||
{
|
||||
public static readonly int DownlandComplete = RuntimeId.ToRuntimeId("DownlandEventDefined.DownlandComplete");
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a23fc7993784a22a430276580df4d13
|
||||
timeCreated: 1730788107
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff5bf341daac5e7408253cd8160fc2bb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,13 @@
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
||||
[EventInterface(EEventGroup.GroupLogic)]
|
||||
public interface IEventLoad
|
||||
{
|
||||
void LoadProgress(float progress,float total);
|
||||
void LoadProgressText(string content);
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf32f7eada4f3ee4da2813223b716117
|
@ -0,0 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public static class LoadEventDefine
|
||||
{
|
||||
|
||||
public static readonly int InitSceneAndData = RuntimeId.ToRuntimeId("LoadEventDefine.InitSceneAndData");
|
||||
public static readonly int UpdateSceneProgress = RuntimeId.ToRuntimeId("LoadEventDefine.UpdateSceneProgress");
|
||||
public static readonly int UnLoadSceneProgress = RuntimeId.ToRuntimeId("LoadEventDefine.UnLoadSceneProgress");
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2df30341e36362748be1e04d5bcfe54b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user