Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementazione: #234

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 84 additions & 9 deletions ClassPrj/Assets/FMODStudioCache.asset
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MonoBehaviour:
- {fileID: 11445916}
- {fileID: 11472508}
MasterBankRef: {fileID: 11409300}
stringsBankWriteTime: 635908073478248695
stringsBankWriteTime: 635936949602923249
cacheVersion: 1
--- !u!114 &11408670
MonoBehaviour:
Expand All @@ -54,10 +54,10 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c18180ecb35941f4682ae60107b85b7c, type: 3}
m_Name:
m_Name: FMODStudioCache
m_EditorClassIdentifier:
Path: ./..\FMOD\ClassPrj\Build\Desktop\Bank_SFX.bank
lastModified: 635908073478839609
lastModified: 635936949602858148
LoadResult: 0
FileSizes:
- Name: Desktop
Expand All @@ -75,12 +75,42 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Path: ./..\FMOD\ClassPrj\Build\Desktop\Bank_BGM.bank
lastModified: 635908073478864645
lastModified: 635936949602492590
LoadResult: 0
FileSizes:
- Name: Desktop
Value: 400
Exists: 1
--- !u!114 &11416992
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fecb8ef7f94ca804a8ab72049b86782e, type: 3}
m_Name:
m_EditorClassIdentifier:
Name: Oceano
Min: 0
Max: 1
Default: 0
--- !u!114 &11420536
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fecb8ef7f94ca804a8ab72049b86782e, type: 3}
m_Name:
m_EditorClassIdentifier:
Name: CampFire
Min: 0
Max: 1
Default: 0
--- !u!114 &11420920
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -132,6 +162,21 @@ MonoBehaviour:
Parameters: []
MinDistance: 1
MaxDistance: 20
--- !u!114 &11433080
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fecb8ef7f94ca804a8ab72049b86782e, type: 3}
m_Name: FMODStudioCache
m_EditorClassIdentifier:
Name: Attack
Min: 0
Max: 3
Default: 0
--- !u!114 &11435644
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -151,7 +196,7 @@ MonoBehaviour:
Is3D: 1
IsOneShot: 0
Parameters:
- {fileID: 11408670}
- {fileID: 11486630}
MinDistance: 1
MaxDistance: 20
--- !u!114 &11436690
Expand All @@ -173,7 +218,7 @@ MonoBehaviour:
Is3D: 1
IsOneShot: 0
Parameters:
- {fileID: 11489952}
- {fileID: 11420536}
MinDistance: 1
MaxDistance: 20
--- !u!114 &11437036
Expand All @@ -195,7 +240,7 @@ MonoBehaviour:
Is3D: 1
IsOneShot: 0
Parameters:
- {fileID: 11420920}
- {fileID: 11448352}
MinDistance: 1
MaxDistance: 20
--- !u!114 &11441278
Expand All @@ -217,7 +262,7 @@ MonoBehaviour:
Is3D: 1
IsOneShot: 0
Parameters:
- {fileID: 11484938}
- {fileID: 11416992}
MinDistance: 0
MaxDistance: 10
--- !u!114 &11444322
Expand Down Expand Up @@ -262,6 +307,21 @@ MonoBehaviour:
Parameters: []
MinDistance: 1
MaxDistance: 20
--- !u!114 &11448352
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fecb8ef7f94ca804a8ab72049b86782e, type: 3}
m_Name:
m_EditorClassIdentifier:
Name: CriticalDamage
Min: 0
Max: 100
Default: 0
--- !u!114 &11451334
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -302,7 +362,7 @@ MonoBehaviour:
Is3D: 1
IsOneShot: 0
Parameters:
- {fileID: 11422592}
- {fileID: 11433080}
MinDistance: 1
MaxDistance: 20
--- !u!114 &11472508
Expand Down Expand Up @@ -362,6 +422,21 @@ MonoBehaviour:
Min: 0
Max: 1
Default: 0
--- !u!114 &11486630
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fecb8ef7f94ca804a8ab72049b86782e, type: 3}
m_Name:
m_EditorClassIdentifier:
Name: Death
Min: 0
Max: 100
Default: 100
--- !u!114 &11489952
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
92 changes: 92 additions & 0 deletions ClassPrj/Assets/_Game/Scripts/Editor/SpawnPointEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
using UnityEngine;
using System.Collections;
using UnityEditor;

[CustomEditor(typeof(SpawnPoint))]

public class SpawnPointEditor : Editor {

private SpawnPoint spPoint;
private int tmpQuantita;
private float tmpTempo;
private float tmpRaggio;
private bool isDirty = false;
private SerializedObject serializedObject;
//aoidjoi
public override void OnInspectorGUI()
{
EditorGUI.indentLevel = 0;
spPoint = (SpawnPoint)target;

EditorGUILayout.Separator();

EditorGUILayout.BeginVertical(EditorStyles.objectFieldThumb);
GUIStyle stileLabel = new GUIStyle(GUI.skin.GetStyle("Label"));
stileLabel.alignment = TextAnchor.MiddleCenter;
stileLabel.fontStyle = FontStyle.Bold;
stileLabel.fontSize = 14;
GUILayout.Label(new GUIContent("SPAWN POINT "),stileLabel);
EditorGUILayout.EndVertical();
EditorGUILayout.Separator();

EditorGUILayout.BeginVertical(EditorStyles.objectFieldThumb);

EditorGUI.BeginChangeCheck();
serializedObject = new SerializedObject(spPoint);
EditorGUILayout.PropertyField(serializedObject.FindProperty("tipi"), new GUIContent(""), true, GUILayout.Width(130));
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
Undo.RecordObject(spPoint, "Classe Tipo");
EditorUtility.SetDirty(spPoint);
}

EditorGUI.BeginChangeCheck();
serializedObject = new SerializedObject(spPoint);
EditorGUILayout.PropertyField(serializedObject.FindProperty("sesso"), new GUIContent(""), true, GUILayout.Width(130));
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
Undo.RecordObject(spPoint, "Classe Tipo");
EditorUtility.SetDirty(spPoint);
}
//classiPersonaggi tmpTipi = (classiPersonaggi)EditorGUILayout.EnumPopup("Classe Tipo :", spPoint.tipi,GUILayout.Width(130));
//if(tmpTipi != spPoint.tipi)
//{
// spPoint.tipi = tmpTipi;
// Undo.RecordObject(spPoint, "Classe");
//}
tmpQuantita = EditorGUILayout.IntField(new GUIContent("Quantità", "Numero di Oggetti da Istanziare"),(int)Mathf.Clamp(spPoint.quantita,0,int.MaxValue));
if(tmpQuantita != spPoint.quantita)
{
isDirty = true;
Undo.RecordObject(spPoint, "Numero Oggetti");
spPoint.quantita = tmpQuantita;
}
tmpTempo = EditorGUILayout.FloatField(new GUIContent("Tempo", "Tempo da uno spawn a l'altro"), Mathf.Clamp(spPoint.tempo, 0, float.MaxValue));
if (tmpTempo != spPoint.tempo)
{
isDirty = true;
Undo.RecordObject(spPoint, "Tempo Spawn");
spPoint.tempo = tmpTempo;
}
tmpRaggio = EditorGUILayout.FloatField(new GUIContent("Raggio", "Area d'aazione dello Spawn"), Mathf.Clamp(spPoint.raggio, 0, float.MaxValue));
if (tmpRaggio != spPoint.raggio)
{
isDirty = true;
Undo.RecordObject(spPoint, "Raggio di Spawn");
spPoint.raggio = tmpRaggio;
}
if(GUI.changed || isDirty)
{
EditorUtility.SetDirty(spPoint);
}
EditorGUILayout.EndVertical();
}

void OnSceneGUI()
{

}

}
12 changes: 12 additions & 0 deletions ClassPrj/Assets/_Game/Scripts/Editor/SpawnPointEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading