Skip to content
Snippets Groups Projects
Unverified Commit db946c00 authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Moving kenney.nl models to Assets directory, adding SimpleFX for steam effect,...

Moving kenney.nl models to Assets directory, adding SimpleFX for steam effect, adding colliders for table and chairs, changing semantic labeling structure.
parent f5135d6a
No related branches found
No related tags found
No related merge requests found
Showing
with 11768 additions and 707 deletions
File moved
This diff is collapsed.
fileFormatVersion: 2
guid: d739875fb8597497b9959649a521f7ee
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: eb0f540c45f5e49e9a6344e5ba3aad2f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,7 +9,6 @@ namespace dlu
public class SceneControllerEditor : Editor
{
private bool showLabels;
private SemanticLabel[] semanticLabels;
public override void OnInspectorGUI()
{
......@@ -18,28 +17,28 @@ public class SceneControllerEditor : Editor
EditorGUILayout.Space();
ShowSemanticLabels();
this.ShowSemanticLabels(sc);
}
private void ShowSemanticLabels()
private void ShowSemanticLabels(SceneController sc)
{
showLabels = EditorGUILayout.BeginFoldoutHeaderGroup(showLabels, "Semantic labels");
if (showLabels)
{
if (semanticLabels == null || GUILayout.Button("Refresh list of semantic labels"))
if (sc.semanticBehaviours == null || GUILayout.Button("Refresh list of semantic labels"))
{
semanticLabels = GameObject.FindObjectsOfType<SemanticLabel>();
sc.FindSemanticLabels();
}
foreach (SemanticLabel sl in semanticLabels)
foreach (SemanticBehaviour sb in sc.semanticBehaviours)
{
string label = sl.name;
if (sl.is_a.Count() > 0)
string label = sb.GetComponent<InstanceIdentifier>().name;
if (sb.is_a.Count() > 0)
{
label += $" a {sl.is_a[0].Split('#')[1]}";
label += $" a {sb.is_a.Split('#')[1]}";
}
EditorGUILayout.ObjectField(label, sl.gameObject, typeof(GameObject), true);
EditorGUILayout.ObjectField(label, sb.gameObject, typeof(GameObject), true);
}
}
}
......
using UnityEngine;
namespace dlu
{
public class InstanceIdentifier : MonoBehaviour
{
public new string name;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 77200463eb63a4be1b14363f45712f50
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -8,8 +8,16 @@ public class SceneController : MonoBehaviour
{
public string json = "test";
[HideInInspector]
public SemanticBehaviour[] semanticBehaviours;
public void Start()
{
if (semanticBehaviours == null)
{
FindSemanticLabels();
}
string jsonContent = Resources.Load<TextAsset>(json).text;
// Debug.Log(JsonUtility.ToJson(GameObject.Find("Objects/cup").GetComponent<Entity>()));
// List<Entity> scene = JsonConvert.DeserializeObject<List<Entity>>(jsonContent);
......@@ -29,6 +37,11 @@ public class SceneController : MonoBehaviour
// Debug.Log(go);
}
}
public void FindSemanticLabels()
{
this.semanticBehaviours = GameObject.FindObjectsOfType<SemanticBehaviour>();
}
}
}
\ No newline at end of file
using UnityEngine;
namespace dlu
{
[RequireComponent(typeof(InstanceIdentifier))]
public class SemanticBehaviour : MonoBehaviour
{
public string is_a;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment