コード例 #1
0
 public SerializedField(Component reference, bool enabled)
 {
     this.reference = reference;
     this.enabled   = enabled;
     name           = ScaffoldingUtility.CreateFieldName(reference);
     _id            = name.GetHashCode();
 }
コード例 #2
0
        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();
        }