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)); }
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); }
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)); } }
/// <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))); }
/// <summary> /// Remove an animation by animation name hash. /// </summary> public void RemoveAnimationState(StringHash animationNameHash) { Runtime.ValidateRefCounted(this); AnimatedModel_RemoveAnimationState1(handle, animationNameHash.Code); }
/// <summary> /// Remove a subsystem. /// </summary> public void RemoveSubsystem(StringHash objectType) { Runtime.ValidateRefCounted(this); Context_RemoveSubsystem(handle, objectType.Code); }
/// <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))); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// Send event to all subscribers. /// </summary> public void SendEvent(StringHash eventType) { Runtime.ValidateRefCounted(this); UrhoObject_SendEvent(handle, eventType.Code); }
/// <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); }
/// <summary> /// Unsubscribe from an event. /// </summary> public void UnsubscribeFromEvent(StringHash eventType) { Runtime.ValidateRefCounted(this); UrhoObject_UnsubscribeFromEvent(handle, eventType.Code); }
/// <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); }
/// <summary> /// Return animation track by name hash. /// </summary> public AnimationTrack *GetTrack(StringHash nameHash) { Runtime.ValidateRefCounted(this); return(Animation_GetTrack0(handle, nameHash.Code)); }
/// <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))); }
/// <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)); }
/// <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); }
/// <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)); }
/// <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); }
/// <summary> /// Check current instance is type of specified type. /// </summary> public bool IsInstanceOf(StringHash type) { Runtime.ValidateRefCounted(this); return(UrhoObject_IsInstanceOf(handle, type.Code)); }
/// <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))); }
/// <summary> /// Return vertex morph by name hash. /// </summary> public ModelMorph *GetMorph(StringHash nameHash) { Runtime.ValidateRefCounted(this); return(Model_GetMorph1(handle, nameHash.Code)); }
/// <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); }
/// <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))); }
/// <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); }
/// <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))); }
/// <summary> /// Return vertex morph weight by name hash. /// </summary> public float GetMorphWeight(StringHash nameHash) { Runtime.ValidateRefCounted(this); return(AnimatedModel_GetMorphWeight10(handle, nameHash.Code)); }
/// <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))); }