Esempio n. 1
0
 public RESULT getUserProperty(string name, out USER_PROPERTY property)
 {
     using (StringHelper.ThreadSafeEncoding threadSafeEncoding = StringHelper.GetFreeHelper())
     {
         return(FMOD_Studio_EventDescription_GetUserProperty(handle, threadSafeEncoding.byteFromStringUTF8(name), out property));
     }
 }
Esempio n. 2
0
        public USER_PROPERTY createPublic()
        {
            USER_PROPERTY result = default(USER_PROPERTY);

            result.name = MarshallingHelper.stringFromNativeUtf8(this.name);
            result.type = this.type;
            switch (this.type)
            {
            case USER_PROPERTY_TYPE.INTEGER:
                result.intValue = this.value.intValue;
                break;

            case USER_PROPERTY_TYPE.BOOLEAN:
                result.boolValue = this.value.boolValue;
                break;

            case USER_PROPERTY_TYPE.FLOAT:
                result.floatValue = this.value.floatValue;
                break;

            case USER_PROPERTY_TYPE.STRING:
                result.stringValue = MarshallingHelper.stringFromNativeUtf8(this.value.stringValue);
                break;
            }
            return(result);
        }
        public RESULT getUserProperty(string name, out USER_PROPERTY property)
        {
            USER_PROPERTY_INTERNAL uSER_PROPERTY_INTERNAL;
            RESULT rESULT = EventDescription.FMOD_Studio_EventDescription_GetUserProperty(this.rawPtr, Encoding.UTF8.GetBytes(name + '\0'), out uSER_PROPERTY_INTERNAL);

            if (rESULT != RESULT.OK)
            {
                property = default(USER_PROPERTY);
                return(rESULT);
            }
            property = uSER_PROPERTY_INTERNAL.createPublic();
            return(RESULT.OK);
        }
        public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property)
        {
            USER_PROPERTY_INTERNAL uSER_PROPERTY_INTERNAL;
            RESULT rESULT = EventDescription.FMOD_Studio_EventDescription_GetUserPropertyByIndex(this.rawPtr, index, out uSER_PROPERTY_INTERNAL);

            if (rESULT != RESULT.OK)
            {
                property = default(USER_PROPERTY);
                return(rESULT);
            }
            property = uSER_PROPERTY_INTERNAL.createPublic();
            return(RESULT.OK);
        }
Esempio n. 5
0
        public UserProperty(USER_PROPERTY property)
            : this()
        {
            Name = property.name;
            Type = (UserPropertyType)property.type;

            switch (Type)
            {
                case UserPropertyType.Integer:
                    _value.IntValue = property.intValue;
                    break;
                case UserPropertyType.Single:
                    _value.FloatValue = property.floatValue;
                    break;
                case UserPropertyType.Boolean:
                    _value.BoolValue = property.boolValue;
                    break;
                case UserPropertyType.String:
                    _stringValue = property.stringValue;
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 6
0
        // Helper functions
        public USER_PROPERTY createPublic()
        {
            USER_PROPERTY publicProperty = new USER_PROPERTY();
            publicProperty.name = MarshallingHelper.stringFromNativeUtf8(name);
            publicProperty.type = type;

            switch (type)
            {
                case USER_PROPERTY_TYPE.INTEGER:
                    publicProperty.intValue = value.intValue;
                    break;
                case USER_PROPERTY_TYPE.BOOLEAN:
                    publicProperty.boolValue = value.boolValue;
                    break;
                case USER_PROPERTY_TYPE.FLOAT:
                    publicProperty.floatValue = value.floatValue;
                    break;
                case USER_PROPERTY_TYPE.STRING:
                    publicProperty.stringValue = MarshallingHelper.stringFromNativeUtf8(value.stringValue);
                    break;
            }

            return publicProperty;
        }
Esempio n. 7
0
        public RESULT getUserProperty(string name, out USER_PROPERTY property)
        {
            USER_PROPERTY_INTERNAL propertyInternal;

            RESULT result = FMOD_Studio_EventDescription_GetUserProperty(
                rawPtr, Encoding.UTF8.GetBytes(name + Char.MinValue), out propertyInternal);
            if (result != RESULT.OK)
            {
                property = new USER_PROPERTY();
                return result;
            }

            property = propertyInternal.createPublic();

            return RESULT.OK;
        }
Esempio n. 8
0
        public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property)
        {
            USER_PROPERTY_INTERNAL propertyInternal;

            RESULT result = FMOD_Studio_EventDescription_GetUserPropertyByIndex(rawPtr, index, out propertyInternal);
            if (result != RESULT.OK)
            {
                property = new USER_PROPERTY();
                return result;
            }

            property = propertyInternal.createPublic();

            return RESULT.OK;
        }
Esempio n. 9
0
 public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property)
 {
     return(FMOD_Studio_EventDescription_GetUserPropertyByIndex(handle, index, out property));
 }
Esempio n. 10
0
 private static extern RESULT FMOD_Studio_EventDescription_GetUserProperty(IntPtr eventdescription, byte[] name, out USER_PROPERTY property);
Esempio n. 11
0
 private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyByIndex(IntPtr eventdescription, int index, out USER_PROPERTY property);