提交 b99e63eb 编写于 作者: 魔术师Dix's avatar 魔术师Dix

【Sample】更新示例代码;

上级 92ee82ae
...@@ -9,3 +9,5 @@ ...@@ -9,3 +9,5 @@
/obj /obj
/Assets/Plugins /Assets/Plugins
/Assets/Plugins.meta /Assets/Plugins.meta
/Assets/SceneDependencyCache
/Assets/SceneDependencyCache.meta
...@@ -23,7 +23,7 @@ namespace Aster.Sample ...@@ -23,7 +23,7 @@ namespace Aster.Sample
[ShowInInspector] [ShowInInspector]
private int StartIndex = 10; private int StartIndex = 10;
public int GetIndex { get { return StartIndex++; } } public int GetIndex { get { return StartIndex; } }
} }
......
/*
*Copyright(C) 2023 by Chief All rights reserved.
*Unity版本:2022.2.0b14
*作者:Chief
*创建日期: 2022-12-07
*模块说明:示例创建器
*版本: 1.0
*/
using Sirenix.OdinInspector;
using Unity.Entities;
using UnityEngine;
namespace Aster.Sample
{
/// <summary>
/// 测试用的,创建一个Entity;
/// </summary>
public class SampleEntityCreator : MonoBehaviour
{
[HideInEditorMode]
[Button("创建Enttiy", ButtonSizes.Medium)]
public void CreateEntity()
{
var manager = World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = manager.CreateEntity();
manager.AddComponentData(entity, new ASampleData_ID(999));
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 5640810aee4a5374f95666411c6a557e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -174,7 +174,7 @@ Transform: ...@@ -174,7 +174,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &705507993 --- !u!1 &705507993
GameObject: GameObject:
...@@ -362,3 +362,47 @@ Transform: ...@@ -362,3 +362,47 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1615875119
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1615875121}
- component: {fileID: 1615875120}
m_Layer: 0
m_Name: SampleEntityCreator
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1615875120
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1615875119}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5640810aee4a5374f95666411c6a557e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1615875121
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1615875119}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.25, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册