Esempio n. 1
0
        internal void GeneratePersistFields(RSTypeAssembly inAssembly)
        {
            using (PooledList <RSPersistFieldInfo> persistFields = PooledList <RSPersistFieldInfo> .Alloc())
            {
                foreach (var persistField in Reflect.FindFields <RSPersistFieldAttribute>(OwnerType, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
                {
                    FieldInfo field = persistField.Info;
                    RSPersistFieldAttribute fieldAttr = persistField.Attribute;

                    RSPersistFieldInfo fieldInfo = new RSPersistFieldInfo(fieldAttr, field);
                    persistFields.Add(fieldInfo);
                }

                if (persistFields.Count > 0)
                {
                    m_PersistFields = new Dictionary <string, RSPersistFieldInfo>(persistFields.Count);
                    for (int i = 0; i < persistFields.Count; ++i)
                    {
                        RSPersistFieldInfo info = persistFields[i];
                        info.Link(inAssembly);
                        m_PersistFields.Add(info.Name, info);
                    }
                }
            }
        }
Esempio n. 2
0
        internal override void Link(RSTypeAssembly inAssembly)
        {
            m_MethodSettings.Configure(m_MethodInfo, m_Parameters, true);
            OwnerType = m_MethodSettings.BoundType;

            GenerateParameters(inAssembly);
        }
Esempio n. 3
0
 public void AddDependency(RSTypeAssembly inAssembly)
 {
     if (!m_Dependencies.Contains(inAssembly))
     {
         m_Dependencies.Add(inAssembly);
     }
 }
Esempio n. 4
0
        internal override void Link(RSTypeAssembly inAssembly)
        {
            m_UseCustomDataField = typeof(IRSCustomPersistDataProvider).IsAssignableFrom(OwnerType);

            GeneratePersistFields(inAssembly);

            HasPersistentFields = m_UseCustomDataField || (m_PersistFields != null && m_PersistFields.Count > 0);
        }
Esempio n. 5
0
        internal override void Link(RSTypeAssembly inAssembly)
        {
            m_MethodSettings.Configure(m_MethodInfo, m_Parameters, true);
            OwnerType = m_MethodSettings.BoundType;

            ReturnType     = RSInterop.RSTypeFor(m_MethodInfo.ReturnType, inAssembly);
            m_DefaultValue = m_DefaultSystemValue != null?RSInterop.ToRSValue(m_DefaultSystemValue) : ReturnType.DefaultValue;

            GenerateParameters(inAssembly);
        }
Esempio n. 6
0
        static RSBuiltInTypes()
        {
            BaseAssembly = new RSTypeAssembly();

            BaseAssembly.AddTypeMeta(Void);
            BaseAssembly.AddTypeMeta(Any);
            BaseAssembly.AddTypeMeta(Int);
            BaseAssembly.AddTypeMeta(Float);
            BaseAssembly.AddTypeMeta(Bool);
            BaseAssembly.AddTypeMeta(Color);
            BaseAssembly.AddTypeMeta(String);
            BaseAssembly.AddTypeMeta(Enum);
            BaseAssembly.AddTypeMeta(Vector2);
            BaseAssembly.AddTypeMeta(Vector3);
            BaseAssembly.AddTypeMeta(Vector4);
            BaseAssembly.AddTypeMeta(Entity);
            BaseAssembly.AddTypeMeta(Component);
            BaseAssembly.AddTypeMeta(GroupId);
            BaseAssembly.AddTypeMeta(TriggerId);

            // CONVERSIONS

            Int.AddConversions(Float);
            Enum.AddConversions(Int);

            // COMPARISONS

            Any.AllowNumericComparisons();
            Any.AllowStringComparisons();
            Any.AllowBooleanComparisons();

            Int.AllowNumericComparisons();
            Float.AllowNumericComparisons();

            Bool.AllowEqualityComparisons();
            Bool.AllowBooleanComparisons();
            Color.AllowEqualityComparisons();
            String.AllowEqualityComparisons();
            String.AllowStringComparisons();

            Vector2.AllowEqualityComparisons();
            Vector3.AllowEqualityComparisons();
            Vector4.AllowEqualityComparisons();

            Entity.AllowEqualityComparisons();
            GroupId.AllowEqualityComparisons();
            TriggerId.AllowEqualityComparisons();
        }
Esempio n. 7
0
        internal void GenerateParameters(RSTypeAssembly inAssembly)
        {
            int totalArgs = m_Parameters.Length - m_MethodSettings.EditorArgsStartIndex;

            Parameters = new RSParameterInfo[totalArgs];
            for (int i = 0; i < totalArgs; ++i)
            {
                int                  idx            = i + m_MethodSettings.EditorArgsStartIndex;
                ParameterInfo        paramInfo      = m_Parameters[idx];
                RSParameterAttribute paramAttribute = paramInfo.GetCustomAttribute <RSParameterAttribute>();
                Parameters[i] = new RSParameterInfo(paramAttribute, paramInfo);
                Parameters[i].Link(inAssembly);
            }

            TempArgStorage = new RSValue[totalArgs];
        }
Esempio n. 8
0
        internal void Link(RSTypeAssembly inAssembly)
        {
            Type = RSInterop.RSTypeFor(m_ParameterType, inAssembly);
            if (m_ParameterInfo != null && m_ParameterInfo.HasDefaultValue)
            {
                Default = RSInterop.ToRSValue(m_ParameterInfo.DefaultValue);
            }
            else
            {
                Default = Type.DefaultValue;
            }

            if (m_TriggerParameterType != null)
            {
                TriggerParameterType = RSInterop.RSTypeFor(m_TriggerParameterType, inAssembly);
            }
        }
Esempio n. 9
0
 internal abstract void Link(RSTypeAssembly inAssembly);
Esempio n. 10
0
 internal override void Link(RSTypeAssembly inAssembly)
 {
     ParameterType?.Link(inAssembly);
 }
Esempio n. 11
0
 public RSLibrary(Type inEntityType)
 {
     TypeAssembly = new RSTypeAssembly(RSBuiltInTypes.BaseAssembly);
     m_EntityType = inEntityType;
 }
Esempio n. 12
0
 internal void Link(RSTypeAssembly inAssembly)
 {
     Type = RSInterop.RSTypeFor(m_FieldType, inAssembly);
 }