Skip to content

Commit

Permalink
Fix issues with naming
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoburatto committed Oct 30, 2023
1 parent 7ddbfcf commit f61f40d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
using System;
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;

namespace SS3D.CodeGeneration
namespace SS3D.CodeGeneration.Creators
{
public static class DatabaseAssetCreator
{
#if UNITY_EDITOR
/// <summary>
/// Creates an enum in the object path, with the defined enum name and using a list of provided assets as its elements.
/// Creates a list of database assets in the object path, with the defined class name and using a list of provided assets as its elements.
/// </summary>
/// <param name="assetPathSource"></param>
/// <param name="enumName"></param>
/// <param name="assets"></param>
public static void CreateAtPath(string path, Type classType, string className, IEnumerable<Object> assets, string namespaceName = "SS3D.Data.Enums")
public static void CreateAtPath(string path, Type classType, string className, [NotNull] IEnumerable<Object> assets, string namespaceName = "SS3D.Data.Generated")
{
IEnumerable<string> enums = assets.Select(reference => reference.name);

Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/SS3D/CodeGeneration/Creators/EnumCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEngine;
using Object = UnityEngine.Object;

namespace SS3D.CodeGeneration
namespace SS3D.CodeGeneration.Creators
{
public static class EnumCreator
{
Expand All @@ -20,6 +20,8 @@ public static void CreateAtPath(string path, string enumName, IEnumerable<Object
IEnumerable<string> enums = assets.Select(reference => reference.name);

List<string> enumerable = enums.ToList();

// Added to support the option to not select an enum.
enumerable.Insert(0, "None");

string dataPath = Application.dataPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using JetBrains.Annotations;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
Expand All @@ -9,12 +10,9 @@ public static class StaticClassCreator
{
#if UNITY_EDITOR
/// <summary>
/// Creates an enum in the object path, with the defined enum name and using a list of provided assets as its elements.
/// Creates an static class in the object path, with the defined class name and using a list of provided assets as its elements.
/// </summary>
/// <param name="assetPathSource"></param>
/// <param name="enumName"></param>
/// <param name="assets"></param>
public static void CreateAtPath(string path, string className, IEnumerable<Object> assets, string namespaceName = "SS3D.Data.Enums")
public static void CreateAtPath(string path, string className, [NotNull] IEnumerable<Object> assets, string namespaceName = "SS3D.Data.Enums")
{
IEnumerable<string> enums = assets.Select(reference => reference.name);

Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/SS3D/Data/AssetDatabases/AssetDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using Object = UnityEngine.Object;
using SS3D.CodeGeneration;
using SS3D.CodeGeneration.Creators;
using UnityEditor;
using UnityEngine;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Coimbra;
using SS3D.Attributes;
using SS3D.CodeGeneration;
using SS3D.CodeGeneration.Creators;
using UnityEngine;

namespace SS3D.Data.AssetDatabases
Expand Down

0 comments on commit f61f40d

Please sign in to comment.