-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e8ae41
commit fd20d29
Showing
7 changed files
with
250 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class RotateObject extends ObjectComponent{ | ||
//test:GameObject | ||
tt:string | ||
num:number | ||
cold:string | ||
newValue:number | ||
|
||
|
||
|
||
onEnable(){ | ||
console.log(this.test) | ||
} | ||
onLoad(){ | ||
|
||
} | ||
start(){ | ||
|
||
} | ||
|
||
update(){ | ||
|
||
} | ||
|
||
|
||
//constructor(object, smart){ | ||
//super(object) | ||
//const userData = object.userData.RotateObject | ||
|
||
// int, float, string, array | ||
|
||
|
||
//this.value = userData.value; // int | ||
//} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using UnityEditor; | ||
|
||
|
||
public static class ObjectNamesUtility | ||
{ | ||
public static Dictionary<Type, string> GetInternalInspectorTitlesCache() | ||
{ | ||
Type inspectorTitlesType = typeof(ObjectNames).GetNestedType("InspectorTitles", BindingFlags.Static | BindingFlags.NonPublic); | ||
var inspectorTitlesField = inspectorTitlesType.GetField("s_InspectorTitles", BindingFlags.Static | BindingFlags.NonPublic); | ||
return (Dictionary<Type, string>)inspectorTitlesField.GetValue(null); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
111 changes: 110 additions & 1 deletion
111
Scripts/GLTFExporter/GLTFGenerator/SmartObjects/SmartObjectBehaviour.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,124 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using System; | ||
|
||
namespace WEBGL_EXPORTER.GLTF | ||
{ | ||
public class SmartObjectBehaviour : MonoBehaviour | ||
{ | ||
public Object javascript; | ||
|
||
[SerializeField] | ||
public List<JSVar> allVars; | ||
|
||
|
||
public UnityEngine.Object javascript; | ||
|
||
private void Start() | ||
{ | ||
// do nothing, just need the checkbox | ||
} | ||
|
||
public JSVar getExistingJSVar(string var_name, string type = "") | ||
{ | ||
if (allVars == null) | ||
return null; | ||
|
||
foreach (JSVar jsvar in allVars) | ||
{ | ||
if (jsvar.isSame(var_name, type)) | ||
return jsvar; | ||
} | ||
return null; | ||
} | ||
|
||
} | ||
|
||
|
||
[Serializable] | ||
public class JSVar | ||
{ | ||
[SerializeField] | ||
public string varName = ""; | ||
[SerializeField] | ||
public string typeName = ""; | ||
|
||
public SmartObjectBehaviour scriptValue; | ||
public string stringValue; | ||
public float numberValue; | ||
public JSVar(string var_name, string type_name) | ||
{ | ||
varName = var_name; | ||
typeName = type_name; | ||
} | ||
public virtual bool isSame(string var_name, string var_type) | ||
{ | ||
return varName == var_name; | ||
} | ||
|
||
public virtual string getJsVarName() | ||
{ | ||
return typeName; | ||
} | ||
} | ||
//[Serializable] | ||
//public class JSScript : JSVar | ||
//{ | ||
// [SerializeField] | ||
// public SmartObjectBehaviour varValue; | ||
|
||
// public JSScript(string var_name, string type_name) | ||
// { | ||
// varName = var_name; | ||
// typeName = type_name; | ||
// } | ||
// public override bool isSame(string var_name, string var_type) | ||
// { | ||
// if (var_type == "") | ||
// { | ||
// return false; | ||
// } | ||
// return base.isSame(var_name, ""); | ||
// } | ||
//} | ||
//[Serializable] | ||
//public class JSString : JSVar | ||
//{ | ||
|
||
// [SerializeField] | ||
// public string varValue; | ||
// public JSString(string var_name) | ||
// { | ||
// varName = var_name; | ||
// varValue = ""; | ||
// typeName = "string"; | ||
// } | ||
// public override bool isSame(string var_name, string var_type) | ||
// { | ||
// if (var_type != "string") | ||
// { | ||
// return false; | ||
// } | ||
// return base.isSame(var_name, ""); | ||
// } | ||
//} | ||
//[Serializable] | ||
//public class JSNumber : JSVar | ||
//{ | ||
// [SerializeField] | ||
// public float varValue; | ||
// public JSNumber(string var_name) | ||
// { | ||
// varName = var_name; | ||
// varValue = 0f; | ||
// typeName = "number"; | ||
// } | ||
// public override bool isSame(string var_name, string var_type) | ||
// { | ||
// if (var_type != "number") | ||
// return false; | ||
// return base.isSame(var_name, ""); | ||
// } | ||
|
||
//} | ||
} |