private static void FindGameObjectParameters(Type actionType, FieldInfo field) { if ((field.get_FieldType() == typeof(SkillOwnerDefault) || field.get_FieldType() == typeof(SkillGameObject) || field.get_FieldType() == typeof(GameObject)) && !CustomAttributeHelpers.HasAttribute <CheckForComponentAttribute>(field)) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(GameObject), field.get_Name(), false)); } }
public static void Init() { ActionTargets.lookup.Clear(); using (List <Type> .Enumerator enumerator = Actions.List.GetEnumerator()) { while (enumerator.MoveNext()) { Type current = enumerator.get_Current(); IEnumerable <Attribute> attributes = CustomAttributeHelpers.GetAttributes(current, typeof(ActionTarget)); using (IEnumerator <Attribute> enumerator2 = attributes.GetEnumerator()) { while (enumerator2.MoveNext()) { Attribute current2 = enumerator2.get_Current(); ActionTargets.AddActionTarget(current, (ActionTarget)current2); } } } } using (List <Type> .Enumerator enumerator3 = Actions.List.GetEnumerator()) { while (enumerator3.MoveNext()) { Type current3 = enumerator3.get_Current(); if (!ActionTargets.HasNoActionTargetsAttribute(current3) && !ActionTargets.HasActionTargets(current3)) { ActionTargets.GenerateActionTargets(current3); } } } }
private static void FindObjectTypeAttribute(Type actionType, FieldInfo field) { ObjectTypeAttribute attribute = CustomAttributeHelpers.GetAttribute <ObjectTypeAttribute>(field); if (attribute == null || attribute.get_ObjectType() == null) { return; } ActionTargets.AddActionTarget(actionType, new ActionTarget(attribute.get_ObjectType(), field.get_Name(), false)); }
private static void FindMaterialParameters(Type actionType, FieldInfo field) { if (field.get_FieldType() == typeof(SkillMaterial) || field.get_FieldType() == typeof(Material)) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(Material), field.get_Name(), false)); return; } if (field.get_FieldType() == typeof(SkillTexture) || field.get_FieldType() == typeof(Texture)) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(Texture), field.get_Name(), false)); } }
private static void FindUIHintParameters(Type actionType, FieldInfo field) { IEnumerable <UIHintAttribute> attributes = CustomAttributeHelpers.GetAttributes <UIHintAttribute>(field); using (IEnumerator <UIHintAttribute> enumerator = attributes.GetEnumerator()) { while (enumerator.MoveNext()) { UIHintAttribute current = enumerator.get_Current(); UIHint hint = current.get_Hint(); UIHint uIHint = hint; if (uIHint == 6) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(AnimationClip), field.get_Name(), false)); } } } }
private static void FindColliderParameters(Type actionType, FieldInfo field) { Type fieldType = field.get_FieldType(); if (fieldType == typeof(CollisionType) || fieldType == typeof(TriggerType)) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(Collider), "", false)); ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(Rigidbody), "", false)); ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(GameObject), "", false)); return; } if (fieldType == typeof(Collision2DType) || fieldType == typeof(Trigger2DType)) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(Collider2D), "", false)); ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(Rigidbody2D), "", false)); ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(GameObject), "", false)); } }
private static void FindCheckForComponentAttribute(Type actionType, FieldInfo field) { CheckForComponentAttribute attribute = CustomAttributeHelpers.GetAttribute <CheckForComponentAttribute>(field); if (attribute != null) { if (attribute.get_Type0() != null) { ActionTargets.AddActionTarget(actionType, new ActionTarget(attribute.get_Type0(), field.get_Name(), false)); } if (attribute.get_Type1() != null) { ActionTargets.AddActionTarget(actionType, new ActionTarget(attribute.get_Type1(), field.get_Name(), false)); } if (attribute.get_Type2() != null) { ActionTargets.AddActionTarget(actionType, new ActionTarget(attribute.get_Type2(), field.get_Name(), false)); } } }