示例#1
0
        public T CreateComponent <T> (StringHash type, CreateMode mode = CreateMode.Replicated, uint id = 0) where T : Component
        {
            Runtime.ValidateRefCounted(this);
            var ptr = Node_CreateComponent(handle, type.Code, mode, id);

            return(Runtime.LookupObject <T> (ptr));
        }
示例#2
0
        public Subscription SubscribeToEvent(StringHash eventName, Action <EventDataContainer> handler)
        {
            var s = new Subscription(ptr => handler(new EventDataContainer(ptr)));

            s.UnmanagedProxy = urho_subscribe_event(handle, ObjectCallbackInstance, GCHandle.ToIntPtr(s.gch), eventName.Code);
            return(s);
        }
示例#3
0
文件: Skeleton.cs 项目: wqg2016/urho
 public BoneWrapper GetBoneSafe(StringHash nameHash)
 {
     Runtime.ValidateObject(this);
     unsafe
     {
         Bone *result = Skeleton_GetBone0(handle, nameHash.Code);
         if (result == null)
         {
             return(null);
         }
         return(new BoneWrapper(this, result));
     }
 }
示例#4
0
 /// <summary>
 /// Return animation state by animation name hash.
 /// </summary>
 public AnimationState GetAnimationState(StringHash animationNameHash)
 {
     Runtime.ValidateRefCounted(this);
     return(Runtime.LookupRefCounted <AnimationState> (AnimatedModel_GetAnimationState7(handle, animationNameHash.Code)));
 }
示例#5
0
 /// <summary>
 /// Remove an animation by animation name hash.
 /// </summary>
 public void RemoveAnimationState(StringHash animationNameHash)
 {
     Runtime.ValidateRefCounted(this);
     AnimatedModel_RemoveAnimationState1(handle, animationNameHash.Code);
 }
示例#6
0
 /// <summary>
 /// Remove a subsystem.
 /// </summary>
 public void RemoveSubsystem(StringHash objectType)
 {
     Runtime.ValidateRefCounted(this);
     Context_RemoveSubsystem(handle, objectType.Code);
 }
示例#7
0
 /// <summary>
 /// Return object type name from hash, or empty if unknown.
 /// </summary>
 public string GetTypeName(StringHash objectType)
 {
     Runtime.ValidateRefCounted(this);
     return(Marshal.PtrToStringAnsi(Context_GetTypeName(handle, objectType.Code)));
 }
示例#8
0
 /// <summary>
 /// Set global variable with the respective key and value
 /// </summary>
 public void SetGlobalVar(StringHash key, Matrix3x4 value)
 {
     Runtime.ValidateRefCounted(this);
     Context_SetGlobalVar8(handle, key.Code, ref value);
 }
示例#9
0
 /// <summary>
 /// Set global variable with the respective key and value
 /// </summary>
 public void SetGlobalVar(StringHash key, IntVector2 value)
 {
     Runtime.ValidateRefCounted(this);
     Context_SetGlobalVar5(handle, key.Code, ref value);
 }
示例#10
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Set global variable with the respective key and value
 /// </summary>
 public void SetGlobalVar(StringHash key, float value)
 {
     Runtime.ValidateRefCounted(this);
     UrhoObject_SetGlobalVar10(handle, key.Code, value);
 }
示例#11
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Set global variable with the respective key and value
 /// </summary>
 public void SetGlobalVar(StringHash key, Matrix4 value)
 {
     Runtime.ValidateRefCounted(this);
     UrhoObject_SetGlobalVar7(handle, key.Code, ref value);
 }
示例#12
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Send event to all subscribers.
 /// </summary>
 public void SendEvent(StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     UrhoObject_SendEvent(handle, eventType.Code);
 }
示例#13
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Unsubscribe from a specific sender's event.
 /// </summary>
 public void UnsubscribeFromEvent(Urho.UrhoObject sender, StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     UrhoObject_UnsubscribeFromEvent2(handle, (object)sender == null ? IntPtr.Zero : sender.Handle, eventType.Code);
 }
示例#14
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Unsubscribe from an event.
 /// </summary>
 public void UnsubscribeFromEvent(StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     UrhoObject_UnsubscribeFromEvent(handle, eventType.Code);
 }
示例#15
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Subscribe to a specific sender's event.
 /// </summary>
 public void SubscribeToEvent(Urho.UrhoObject sender, StringHash eventType, IntPtr handler)
 {
     Runtime.ValidateRefCounted(this);
     UrhoObject_SubscribeToEvent1(handle, (object)sender == null ? IntPtr.Zero : sender.Handle, eventType.Code, handler);
 }
示例#16
0
 /// <summary>
 /// Return animation track by name hash.
 /// </summary>
 public AnimationTrack *GetTrack(StringHash nameHash)
 {
     Runtime.ValidateRefCounted(this);
     return(Animation_GetTrack0(handle, nameHash.Code));
 }
示例#17
0
 /// <summary>
 /// Return subsystem by type.
 /// </summary>
 public Urho.UrhoObject GetSubsystem(StringHash type)
 {
     Runtime.ValidateRefCounted(this);
     return(Runtime.LookupRefCounted <Urho.UrhoObject> (Context_GetSubsystem(handle, type.Code)));
 }
示例#18
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Return whether has subscribed to an event without specific sender.
 /// </summary>
 public bool HasSubscribedToEvent(StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     return(UrhoObject_HasSubscribedToEvent(handle, eventType.Code));
 }
示例#19
0
 /// <summary>
 /// Set global variable with the respective key and value
 /// </summary>
 public void SetGlobalVar(StringHash key, Quaternion value)
 {
     Runtime.ValidateRefCounted(this);
     Context_SetGlobalVar6(handle, key.Code, ref value);
 }
示例#20
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Return whether has subscribed to a specific sender's event.
 /// </summary>
 public bool HasSubscribedToEvent(Urho.UrhoObject sender, StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     return(UrhoObject_HasSubscribedToEvent3(handle, (object)sender == null ? IntPtr.Zero : sender.Handle, eventType.Code));
 }
示例#21
0
 /// <summary>
 /// Set global variable with the respective key and value
 /// </summary>
 public void SetGlobalVar(StringHash key, string value)
 {
     Runtime.ValidateRefCounted(this);
     Context_SetGlobalVar11(handle, key.Code, value);
 }
示例#22
0
文件: UrhoObject.cs 项目: tlatt/urho
 /// <summary>
 /// Check current instance is type of specified type.
 /// </summary>
 public bool IsInstanceOf(StringHash type)
 {
     Runtime.ValidateRefCounted(this);
     return(UrhoObject_IsInstanceOf(handle, type.Code));
 }
示例#23
0
 /// <summary>
 /// Create an object by type hash. Return pointer to it or null if no factory found.
 /// </summary>
 public UrhoObject CreateObject(StringHash objectType)
 {
     Runtime.ValidateRefCounted(this);
     return(Runtime.LookupRefCounted <UrhoObject> (Context_CreateObject(handle, objectType.Code)));
 }
示例#24
0
文件: Model.cs 项目: vladkol/urho
 /// <summary>
 /// Return vertex morph by name hash.
 /// </summary>
 public ModelMorph *GetMorph(StringHash nameHash)
 {
     Runtime.ValidateRefCounted(this);
     return(Model_GetMorph1(handle, nameHash.Code));
 }
示例#25
0
 /// <summary>
 /// Copy base class attributes to derived class.
 /// </summary>
 public void CopyBaseAttributes(StringHash baseType, StringHash derivedType)
 {
     Runtime.ValidateRefCounted(this);
     Context_CopyBaseAttributes(handle, baseType.Code, derivedType.Code);
 }
示例#26
0
文件: Context.cs 项目: tlatt/urho
 /// <summary>
 /// Return event receivers for a sender and event type, or null if they do not exist.
 /// </summary>
 public EventReceiverGroup GetEventReceivers(Urho.UrhoObject sender, StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     return(Runtime.LookupRefCounted <EventReceiverGroup> (Context_GetEventReceivers(handle, (object)sender == null ? IntPtr.Zero : sender.Handle, eventType.Code)));
 }
示例#27
0
 /// <summary>
 /// Set vertex morph weight by name hash.
 /// </summary>
 public void SetMorphWeight(StringHash nameHash, float weight)
 {
     Runtime.ValidateRefCounted(this);
     AnimatedModel_SetMorphWeight5(handle, nameHash.Code, weight);
 }
示例#28
0
文件: Context.cs 项目: tlatt/urho
 /// <summary>
 /// Return event receivers for an event type, or null if they do not exist.
 /// </summary>
 public EventReceiverGroup GetEventReceivers(StringHash eventType)
 {
     Runtime.ValidateRefCounted(this);
     return(Runtime.LookupRefCounted <EventReceiverGroup> (Context_GetEventReceivers0(handle, eventType.Code)));
 }
示例#29
0
 /// <summary>
 /// Return vertex morph weight by name hash.
 /// </summary>
 public float GetMorphWeight(StringHash nameHash)
 {
     Runtime.ValidateRefCounted(this);
     return(AnimatedModel_GetMorphWeight10(handle, nameHash.Code));
 }
示例#30
0
 /// <summary>
 /// Return a node user variable name, or empty if not registered.
 /// </summary>
 public string GetVarName(StringHash hash)
 {
     Runtime.ValidateRefCounted(this);
     return(Marshal.PtrToStringAnsi(Scene_GetVarName(handle, hash.Code)));
 }