本文整理汇总了C#中UnityEngine.GameObject.Init方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.Init方法的具体用法?C# GameObject.Init怎么用?C# GameObject.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.GameObject
的用法示例。
在下文中一共展示了GameObject.Init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onEntityCreated
void onEntityCreated(Pool pool, Entity entity) {
entity.componentNames = _componentNames;
var entityBehaviour = new GameObject().AddComponent<EntityBehaviour>();
entityBehaviour.Init(_pool, entity, _componentNames, _componentTypes);
entityBehaviour.transform.SetParent(_entitiesContainer, false);
}
示例2: addDebugComponent
void addDebugComponent(Entity entity)
{
var debugBehaviour = new GameObject().AddComponent<EntityDebugBehaviour>();
debugBehaviour.Init(this, entity, _debugIndex);
debugBehaviour.transform.SetParent(_entitiesContainer, false);
var debugComponent = new DebugComponent();
debugComponent.debugBehaviour = debugBehaviour;
entity.AddComponent(_debugIndex, debugComponent);
}
示例3: Load
/// <summary>
///
/// </summary>
/// <param name="fullUrl"></param>
/// <param name="saveFullPath">完整的保存路径!</param>
/// <param name="useContinue">是否断点续传</param>
/// <param name="useCache">如果存在则不下载了!</param>
/// <param name="expireDays"></param>
/// <param name="timeout"></param>
public static KHttpDownloader Load(string fullUrl, string saveFullPath, bool useContinue = false,
bool useCache = false, int expireDays = 1, int timeout = 5)
{
var downloader = new GameObject("HttpDownloader+" + fullUrl).AddComponent<KHttpDownloader>();
downloader.Init(fullUrl, saveFullPath, useContinue, useCache, expireDays, timeout);
DontDestroyOnLoad(downloader.gameObject);
return downloader;
}
示例4: onEntityCreated
void onEntityCreated(Pool pool, Entity entity)
{
var entityBehaviour = new GameObject().AddComponent<EntityBehaviour>();
entityBehaviour.Init(pool, entity);
entityBehaviour.transform.SetParent(_entitiesContainer, false);
}
示例5: onEntityCreated
void onEntityCreated(Context context, Entity entity)
{
var entityBehaviour = new GameObject().AddComponent<EntityBehaviour>();
entityBehaviour.Init(context, entity);
entityBehaviour.transform.SetParent(_gameObject.transform, false);
}