예제 #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)));
 }