Show / Hide Table of Contents

Class EntityRegAttribute

An Attribute used to describe entities. This should be used to register new entities by adding attaching it to an entity's class.

Inheritance
System.Object
System.Attribute
EntityRegAttribute
Implements
System.Runtime.InteropServices._Attribute
Inherited Members
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.Equals(System.Object)
System.Attribute.GetHashCode()
System.Attribute.Match(System.Object)
System.Attribute.IsDefaultAttribute()
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
System.Attribute.TypeId
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: DuneNet.Shared.Entities
Assembly: DuneNet.Shared.dll
Syntax
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public class EntityRegAttribute : Attribute, _Attribute

Constructors

EntityRegAttribute(String, String, NetworkContext, String)

Constructor.

Declaration
public EntityRegAttribute(string name, string prefabPath, NetworkContext context, string assetBundle = null)
Parameters
Type Name Description
System.String name

The registration name of the entity.

System.String prefabPath

The relative path to the prefab of the entity. The path starts inside the Resources folder once it has been mounted by Unity and should not contain the extension. entities/server/test_entity

NetworkContext context

The network context the entity will be used on. Servers cannot spawn client entities and vice versa.

System.String assetBundle

Properties

AssetBundle

The name of the Asset Bundle where the entity prefab is stored

Declaration
public string AssetBundle { get; }
Property Value
Type Description
System.String
Remarks

If this is null or empty, the entity prefab is loaded from the Resources folder.

Context

The network context the entity will be used on.

Declaration
public NetworkContext Context { get; }
Property Value
Type Description
NetworkContext
Remarks

Servers cannot spawn client entities and vice versa.

Name

The registration name of the entity.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

PrefabPath

The relative path to the prefab of the entity.

Declaration
public string PrefabPath { get; }
Property Value
Type Description
System.String
Remarks

The path starts inside the Resources folder once it has been mounted by Unity and should not contain the extension. If using Asset Bundles, this should be the path to the prefab inside the Asset Bundle instead. entities/server/test_entity

Implements

System.Runtime.InteropServices._Attribute
Back to top Copyright © 2018 Dune Interactive.