Making the new dae-feature of schemasim work to use the same objects as the physics simulation.

parent afe85c77
[submodule "SimpleJSON"]
path = SimpleJSON
url = https://github.com/Bunny83/SimpleJSON
[submodule "Assets/SimpleJSON"]
path = Assets/SimpleJSON
url = https://github.com/Bunny83/SimpleJSON
[submodule "Assets/RuntimeColladaImporter"]
path = Assets/RuntimeColladaImporter
url = https://github.com/takashiw/RuntimeColladaImporter
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: cookiedough
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0.78432494, b: 0.28773582, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: a176093a05e0d48649993761c1887ba0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: white
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
fileFormatVersion: 2
guid: e452339b779ac47b5aff033b735a27b5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
using UnityEditor;
using UnityEngine;
namespace dlu
{
[CustomEditor(typeof(SemanticBehaviour), true)]
public class SemanticBehaviourEditor : Editor
{
public override void OnInspectorGUI()
{
SemanticBehaviour sb = (SemanticBehaviour) target;
ConfigureAssetPath(sb);
DrawDefaultInspector();
}
private void ConfigureAssetPath(SemanticBehaviour sb)
{
sb.asset = EditorGUILayout.ObjectField("Asset", sb.asset, typeof(GameObject), false) as GameObject;
if (sb.asset != null)
{
sb.assetPath = AssetDatabase.GetAssetPath(sb.asset).Substring("Assets/".Length);
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 234e7cecbcd7a45d191c077c51d7cb9f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,7 +9,16 @@ public abstract class SemanticBehaviour : MonoBehaviour
{
public string is_a;
public abstract void WriteTo(JSONObject jsonObject);
[HideInInspector]
public GameObject asset;
public string assetPath;
public virtual void WriteTo(JSONObject jsonObject) {
if (assetPath != "")
{
jsonObject["asset"] = $"{Application.dataPath}/{assetPath}";
}
}
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ using SimpleJSON;
namespace dlu
{
public class DesignedContainer : SemanticBehaviour
public class DesignedContainer : Entity
{
public List<Collider> containmentParts;
......@@ -16,6 +16,7 @@ public class DesignedContainer : SemanticBehaviour
public override void WriteTo(JSONObject jsonObject)
{
base.WriteTo(jsonObject);
JSONArray containment = new JSONArray();
foreach (Collider collider in containmentParts)
{
......
......@@ -18,6 +18,7 @@ public class Entity : SemanticBehaviour
public override void WriteTo(JSONObject jsonObject)
{
base.WriteTo(jsonObject);
JSONObject transform = new JSONObject();
transform["position"] = this.transform.position;
transform["orientation"] = this.transform.rotation;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment