public ScriptDependsAttribute(Type type) { var members = type.GetMember( "Instance", MemberTypes.Field | MemberTypes.Property, BindingFlags.Static | BindingFlags.Public ); var script = members.Select(GetScript) .FirstOrDefault((s) => s != null); if (script == null) { throw new ArgumentException("Type does not have a script instance", "type"); } this.script = script; }
public ScriptDependsAttribute(ScriptBase script) { this.script = script; }