Ejemplo n.º 1
0
 /// <summary>Initializes a new instance of the UnityWorld class</summary>
 public UnityWorld(
     LevelDefinition definition,
     IResourceLibrary resources,
     IControllerManager controllerManager,
     IControllerFactory[] controllerFactories,
     IEntityFactory entityFactory)
     : base(definition, resources, controllerManager, controllerFactories, entityFactory)
 {
     SafeECall.Invoke(() => WorldBehaviour.Instance.World = this);
 }
Ejemplo n.º 2
0
 /// <summary>Adds an ObjectBehaviour to the UnityAvatar</summary>
 /// <typeparam name="TBehaviour">ObjectBehaviour type</typeparam>
 /// <param name="avatar">Unity avatar</param>
 /// <returns>The added behaviour</returns>
 public static TBehaviour AddObjectBehaviour <TBehaviour>(this UnityAvatar avatar)
     where TBehaviour : ObjectBehaviour
 {
     return(SafeECall.Invoke <TBehaviour>(() => avatar.Collider.gameObject.AddComponent <TBehaviour>()));
 }