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); } } } }
internal override void Link(RSTypeAssembly inAssembly) { m_MethodSettings.Configure(m_MethodInfo, m_Parameters, true); OwnerType = m_MethodSettings.BoundType; GenerateParameters(inAssembly); }
public void AddDependency(RSTypeAssembly inAssembly) { if (!m_Dependencies.Contains(inAssembly)) { m_Dependencies.Add(inAssembly); } }
internal override void Link(RSTypeAssembly inAssembly) { m_UseCustomDataField = typeof(IRSCustomPersistDataProvider).IsAssignableFrom(OwnerType); GeneratePersistFields(inAssembly); HasPersistentFields = m_UseCustomDataField || (m_PersistFields != null && m_PersistFields.Count > 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); }
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(); }
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]; }
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); } }
internal abstract void Link(RSTypeAssembly inAssembly);
internal override void Link(RSTypeAssembly inAssembly) { ParameterType?.Link(inAssembly); }
public RSLibrary(Type inEntityType) { TypeAssembly = new RSTypeAssembly(RSBuiltInTypes.BaseAssembly); m_EntityType = inEntityType; }
internal void Link(RSTypeAssembly inAssembly) { Type = RSInterop.RSTypeFor(m_FieldType, inAssembly); }