public SerializedField(Component reference, bool enabled) { this.reference = reference; this.enabled = enabled; name = ScaffoldingUtility.CreateFieldName(reference); _id = name.GetHashCode(); }
private void CreateScript() { var scriptData = new ScriptContent { @namespace = _settings.DefaultNamespace, typeName = Path.GetFileNameWithoutExtension(_fileLocationPanel.FileName).Replace(" ", ""), fields = GetScaffoldingText(false), usingNamespaces = _fieldsList.Fields.Select(f => f.reference.GetType().Namespace).Distinct().ToArray() }; var template = _settings.ScriptTemplate.text; var path = Path.ChangeExtension(_fileLocationPanel.FullPath, ".cs"); ScaffoldingUtility.CreateScript(scriptData, path, template); #if ASSET_FACTORY GetWindow <AssetFactoryWindow>().Close(); #endif Close(); }