Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (2)
Tags (14)
master
v2019.1.1
v2019.1.0
v3.1.8
v3.1.7
v3.1.6
v3.1.5
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.9
v3.0.8
v3.0.7
v3.0.6
master
Branches (2)
Tags (14)
master
v2019.1.1
v2019.1.0
v3.1.8
v3.1.7
v3.1.6
v3.1.5
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.9
v3.0.8
v3.0.7
v3.0.6
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (2)
Tags (14)
master
v2019.1.1
v2019.1.0
v3.1.8
v3.1.7
v3.1.6
v3.1.5
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.9
v3.0.8
v3.0.7
v3.0.6
UnityGameFramework
/
Scripts
/
Runtime
/
DataNode
/
DataNodeComponent.cs
UnityGameFramework
/
Scripts
/
Runtime
/
DataNode
/
DataNodeComponent.cs
DataNodeComponent.cs 7.16 KB
Copy Edit Raw Blame History
Jiang Yin authored 2018年12月17日 17:24 +08:00 . 更新版权信息
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2019 Jiang Yin. All rights reserved.
// Homepage: http://gameframework.cn/
// Feedback: mailto:jiangyin@gameframework.cn
//------------------------------------------------------------
using GameFramework;
using GameFramework.DataNode;
using UnityEngine;
namespace UnityGameFramework.Runtime
{
/// <summary>
/// 数据结点组件。
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("Game Framework/Data Node")]
public sealed class DataNodeComponent : GameFrameworkComponent
{
private IDataNodeManager m_DataNodeManager = null;
/// <summary>
/// 游戏框架组件初始化。
/// </summary>
protected override void Awake()
{
base.Awake();
m_DataNodeManager = GameFrameworkEntry.GetModule<IDataNodeManager>();
if (m_DataNodeManager == null)
{
Log.Fatal("Data node manager is invalid.");
return;
}
}
private void Start()
{
}
/// <summary>
/// 获取根数据结点。
/// </summary>
public IDataNode Root
{
get
{
return m_DataNodeManager.Root;
}
}
/// <summary>
/// 根据类型获取数据结点的数据。
/// </summary>
/// <typeparam name="T">要获取的数据类型。</typeparam>
/// <param name="path">相对于 node 的查找路径。</param>
/// <returns>指定类型的数据。</returns>
public T GetData<T>(string path) where T : Variable
{
return m_DataNodeManager.GetData<T>(path);
}
/// <summary>
/// 获取数据结点的数据。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <returns>数据结点的数据。</returns>
public Variable GetData(string path)
{
return m_DataNodeManager.GetData(path);
}
/// <summary>
/// 根据类型获取数据结点的数据。
/// </summary>
/// <typeparam name="T">要获取的数据类型。</typeparam>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
/// <returns>指定类型的数据。</returns>
public T GetData<T>(string path, IDataNode node) where T : Variable
{
return m_DataNodeManager.GetData<T>(path, node);
}
/// <summary>
/// 获取数据结点的数据。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
/// <returns>数据结点的数据。</returns>
public Variable GetData(string path, IDataNode node)
{
return m_DataNodeManager.GetData(path, node);
}
/// <summary>
/// 设置数据结点的数据。
/// </summary>
/// <typeparam name="T">要设置的数据类型。</typeparam>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="data">要设置的数据。</param>
public void SetData<T>(string path, T data) where T : Variable
{
m_DataNodeManager.SetData(path, data);
}
/// <summary>
/// 设置数据结点的数据。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="data">要设置的数据。</param>
public void SetData(string path, Variable data)
{
m_DataNodeManager.SetData(path, data);
}
/// <summary>
/// 设置数据结点的数据。
/// </summary>
/// <typeparam name="T">要设置的数据类型。</typeparam>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="data">要设置的数据。</param>
/// <param name="node">查找起始结点。</param>
public void SetData<T>(string path, T data, IDataNode node) where T : Variable
{
m_DataNodeManager.SetData(path, data, node);
}
/// <summary>
/// 设置数据结点的数据。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="data">要设置的数据。</param>
/// <param name="node">查找起始结点。</param>
public void SetData(string path, Variable data, IDataNode node)
{
m_DataNodeManager.SetData(path, data, node);
}
/// <summary>
/// 获取数据结点。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <returns>指定位置的数据结点,如果没有找到,则返回空。</returns>
public IDataNode GetNode(string path)
{
return m_DataNodeManager.GetNode(path);
}
/// <summary>
/// 获取数据结点。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
/// <returns>指定位置的数据结点,如果没有找到,则返回空。</returns>
public IDataNode GetNode(string path, IDataNode node)
{
return m_DataNodeManager.GetNode(path, node);
}
/// <summary>
/// 获取或增加数据结点。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <returns>指定位置的数据结点,如果没有找到,则增加相应的数据结点。</returns>
public IDataNode GetOrAddNode(string path)
{
return m_DataNodeManager.GetOrAddNode(path);
}
/// <summary>
/// 获取或增加数据结点。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
/// <returns>指定位置的数据结点,如果没有找到,则增加相应的数据结点。</returns>
public IDataNode GetOrAddNode(string path, IDataNode node)
{
return m_DataNodeManager.GetOrAddNode(path, node);
}
/// <summary>
/// 移除数据结点。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
public void RemoveNode(string path)
{
m_DataNodeManager.RemoveNode(path);
}
/// <summary>
/// 移除数据结点。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
public void RemoveNode(string path, IDataNode node)
{
m_DataNodeManager.RemoveNode(path, node);
}
/// <summary>
/// 移除所有数据结点。
/// </summary>
public void Clear()
{
m_DataNodeManager.Clear();
}
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/XTST/UnityGameFramework.git
git@gitee.com:XTST/UnityGameFramework.git
XTST
UnityGameFramework
UnityGameFramework
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /