113 lines
3.2 KiB
C#
113 lines
3.2 KiB
C#
using NaughtyAttributes;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
public class mainComponent
|
|
{
|
|
[Header("Input the scripts for the components as intstructed by their name")]
|
|
[Tooltip("Input the Grab Interactable script here")] public MonoScript GrabInteractable;
|
|
[Tooltip("Input the Mechanical Block script here")] public MonoScript MechanicalBlock;
|
|
[Tooltip("Input the Attachable Block script here")] public MonoScript AttachableBlock;
|
|
[Tooltip("Input the Socket Container script here")] public MonoScript SocketContainer;
|
|
[Tooltip("Input the Placement Validator script here")] public MonoScript PlacementValidator;
|
|
[Tooltip("Input the Socket Point script here")] public MonoScript SocketPoint;
|
|
[Tooltip("Input the Block Container Init script here")] public MonoScript ContainerInit;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class blockSettings
|
|
{
|
|
[System.Serializable]
|
|
public class GrabInteractableSettings
|
|
{
|
|
[Header("WIP")]
|
|
public string Test;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class MechanicalBlockSettings
|
|
{
|
|
[Header("WIP")]
|
|
public string Test;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class AttachableBlockSettings
|
|
{
|
|
public BlockType Type;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class SocketContainerSettings
|
|
{
|
|
[Header("WIP")]
|
|
public string Test;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class ValidatorSettings
|
|
{
|
|
public LayerMask CollisionLayerMask;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class SocketPointSettings
|
|
{
|
|
public float SocketRadius;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class MiscSettings
|
|
{
|
|
public LayerMask BlockLayer;
|
|
}
|
|
|
|
public GrabInteractableSettings grabInteractable;
|
|
public MechanicalBlockSettings mechanicalBlock;
|
|
public AttachableBlockSettings attachableBlock;
|
|
public SocketContainerSettings socketContainer;
|
|
public ValidatorSettings validator;
|
|
public SocketPointSettings socketPoint;
|
|
public MiscSettings MiscellaneousSettings;
|
|
}
|
|
|
|
[CreateAssetMenu(fileName = "BlockPrefabSettings", menuName = "Youssef Tools/Prefab Creator Settings")]
|
|
public class PrefabCreatorSettings : ScriptableObject
|
|
{
|
|
public mainComponent MainComponents;
|
|
|
|
public blockSettings BlockSettings;
|
|
|
|
public CategoryData categoryData;
|
|
|
|
[Header("-- Save Settings --")]
|
|
[ContextMenuItem("Browse Folder", "Browse")]
|
|
public string SavePath = "Assets/_Project/Prefabs";
|
|
public string Name = "Block";
|
|
public bool IteratedNumbering = false;
|
|
public string Suffix = " vX";
|
|
|
|
[Header("-- Behavior [Leave if unsure] --")]
|
|
public bool OverwriteExisting = false;
|
|
|
|
private void Browse()
|
|
{
|
|
string path = EditorUtility.OpenFolderPanel("Select Save Folder", "Assets", "");
|
|
|
|
if (!string.IsNullOrEmpty(path))
|
|
{
|
|
if (path.StartsWith(Application.dataPath))
|
|
{
|
|
SavePath = "Assets" + path.Substring(Application.dataPath.Length);
|
|
}
|
|
else
|
|
{
|
|
Debug.LogWarning("Please select a folder inside the Assets directory.");
|
|
}
|
|
}
|
|
}
|
|
}
|