Skip to content

Commit 7257dcf

Browse files
committed
Continue Commit from David Gordon
1 parent 0a8b212 commit 7257dcf

404 files changed

Lines changed: 26256 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/Editor.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Ignore.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Prefabs.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Prefabs/CombinedMeshes.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/SeinJS.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/SeinJS/Resources.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using UnityEngine;
2+
using System.Collections.Generic;
3+
using System;
4+
using UnityEditor;
5+
6+
[CustomEditor(typeof(CustomSeinMaterial))]
7+
public class CustomSeinMaterialInspector : SeinCustomMaterialInspector
8+
{
9+
public override string[] GetActiveUniforms() {
10+
return new string[] {
11+
"uniformsTexture",
12+
"uniformsFloat",
13+
"uniformsFloatVec3"
14+
};
15+
}
16+
}
17+
18+
public class CustomSeinMaterial : SeinCustomMaterial
19+
{
20+
CustomSeinMaterial()
21+
{
22+
className = "CustomSeinMaterial";
23+
Array.Resize(ref this.uniformsFloat, 1);
24+
uniformsFloat.SetValue(new SeinMaterialUniformFloat { name = "haha", value = 1 }, 0);
25+
}
26+
}

Assets/SeinJS/Resources/CustomSeinMaterial.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/SeinJS/SeinComponents.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using UnityEngine;
2+
using UnityEditor;
3+
using SeinJS;
4+
using System.IO;
5+
6+
[AddComponentMenu("Sein/Classes/Test Actor")]
7+
public class SeinNodeClass_TestActor : SeinNodeClass
8+
{
9+
[System.Serializable]
10+
public struct TestActorComplex
11+
{
12+
public int x;
13+
public float y;
14+
public Color z;
15+
public Material w;
16+
}
17+
18+
[System.Serializable]
19+
public struct TestActorOptions
20+
{
21+
public int a;
22+
public float b;
23+
public string c;
24+
public bool d;
25+
public Texture2D e;
26+
public Vector2 f;
27+
public Vector3 g;
28+
public Vector4 h;
29+
public Quaternion i;
30+
public Color j;
31+
public float[] k;
32+
public Matrix4x4 l;
33+
public Material m;
34+
public TestActorComplex n;
35+
}
36+
37+
public new TestActorOptions options;
38+
39+
[MenuItem("GameObject/TestSeinNodeClass", priority = 11)]
40+
private static void TTT()
41+
{
42+
var transforms = Selection.GetTransforms(SelectionMode.Deep);
43+
var go = transforms[0].gameObject;
44+
45+
var com = go.GetComponent<SeinNodeClass>();
46+
47+
if (com != null)
48+
{
49+
var res = com.Serialize(null, new Sein_nodeExtension());
50+
var serializer = new Newtonsoft.Json.JsonSerializer();
51+
serializer.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
52+
serializer.Formatting = Newtonsoft.Json.Formatting.Indented;
53+
using (var sw = new StreamWriter("/Users/dtysky/Downloads/testsss.json"))
54+
using (var writer = new Newtonsoft.Json.JsonTextWriter(sw))
55+
{
56+
serializer.Serialize(writer, res);
57+
}
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)