Skip to content

Commit 78dd409

Browse files
committed
a lot of improvement and small changes and docs.
1 parent ea7fb9b commit 78dd409

File tree

56 files changed

+4997
-113
lines changed

Some content is hidden

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

56 files changed

+4997
-113
lines changed

Assets/UnityTensorflow/Common/Editor/ShowAllPropertyDrawer.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44
using UnityEditor;
5+
using System;
56

67
[CustomPropertyDrawer(typeof(ShowAllPropertyAttr),true)]
78
public class ShowAllPropertyDrawer : PropertyDrawer
@@ -19,6 +20,8 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
1920
return;
2021
}
2122

23+
ShowAllPropertyAttr showAll = attribute as ShowAllPropertyAttr;
24+
var notShowNames = showAll.notShowNamesList;
2225

2326
EditorGUI.LabelField(position, "", GUI.skin.horizontalSlider);
2427
float standardSpacing = EditorGUI.GetPropertyHeight(property, label, false);
@@ -38,6 +41,8 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
3841
ite.NextVisible(true);
3942
while (ite.NextVisible(false))
4043
{
44+
if (notShowNames.Contains(ite.name))
45+
continue;
4146
Rect newRect = new Rect(position.x, position.y + prevHeight + EditorGUIUtility.standardVerticalSpacing, position.width, EditorGUI.GetPropertyHeight(ite, label, true));
4247
prevHeight += newRect.height + EditorGUIUtility.standardVerticalSpacing;
4348
EditorGUI.PropertyField(newRect, ite,true);
@@ -60,6 +65,9 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
6065
if (property.objectReferenceValue == null)
6166
return base.GetPropertyHeight(property, label);
6267

68+
ShowAllPropertyAttr showAll = attribute as ShowAllPropertyAttr;
69+
var notShowNames = showAll.notShowNamesList;
70+
6371
SerializedObject childObj = new SerializedObject(property.objectReferenceValue);
6472
SerializedProperty ite = childObj.GetIterator();
6573

@@ -72,6 +80,8 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
7280
ite.NextVisible(true);
7381
while (ite.NextVisible(false))
7482
{
83+
if (notShowNames.Contains(ite.name))
84+
continue;
7585
prevHeight += EditorGUI.GetPropertyHeight(ite, label, true) + EditorGUIUtility.standardVerticalSpacing;
7686
}
7787
prevHeight += standardSpacing + EditorGUIUtility.standardVerticalSpacing;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
// This is not an editor script. The property attribute class should be placed in a regular script file.
2+
using System.Collections.Generic;
23
using UnityEngine;
34

45
public class ShowAllPropertyAttr : PropertyAttribute
56
{
7+
8+
public List<string> notShowNamesList = new List<string>();
69
public ShowAllPropertyAttr()
710
{
811
}
12+
13+
public ShowAllPropertyAttr(params string[] notShowNames)
14+
{
15+
16+
notShowNamesList.AddRange(notShowNames);
17+
}
18+
919
}

Assets/UnityTensorflow/Examples/3DBall/3DBall.unity

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,17 @@ MonoBehaviour:
621621
m_Script: {fileID: 11500000, guid: 80885700eae055d47977cc84fd00de74, type: 3}
622622
m_Name:
623623
m_EditorClassIdentifier:
624-
checkpointTOLoad: {fileID: 0}
624+
checkpointToLoad: {fileID: 0}
625625
trainingEnabled: 0
626626
network: {fileID: 11400000, guid: 1170bea1dbc1f4a449583feba27c4536, type: 2}
627627
optimizer:
628628
optimizerType: 0
629-
parameterList: []
629+
parameterList:
630+
- 0.001
631+
- 0.9
632+
- 0.999
633+
- 0.00000001
634+
- 0
630635
--- !u!114 &667765197
631636
MonoBehaviour:
632637
m_ObjectHideFlags: 0
@@ -1039,7 +1044,7 @@ MonoBehaviour:
10391044
m_Name:
10401045
m_EditorClassIdentifier:
10411046
modelRef: {fileID: 654033468}
1042-
isTraining: 0
1047+
isTraining: 1
10431048
parameters: {fileID: 11400000, guid: 2739dacb167d7df489bcedea5510504d, type: 2}
10441049
continueFromCheckpoint: 1
10451050
checkpointPath: Assets\UnityTensorflow\Examples\3DBall\3DBallCheckpoint.bytes
@@ -1105,6 +1110,7 @@ MonoBehaviour:
11051110
targetFrameRate: 60
11061111
resetParameters:
11071112
resetParameters: []
1113+
bounceTreshold: 2
11081114
--- !u!1 &1746325439
11091115
GameObject:
11101116
m_ObjectHideFlags: 0
0 Bytes
Binary file not shown.

Assets/UnityTensorflow/Examples/3DBall/3DBallNE.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ MonoBehaviour:
609609
m_Name:
610610
m_EditorClassIdentifier:
611611
modelRef: {fileID: 654033468}
612-
isTraining: 0
612+
isTraining: 1
613613
parameters: {fileID: 11400000, guid: 2386b5c0cac59514193ed38630e846a4, type: 2}
614614
continueFromCheckpoint: 1
615615
checkpointPath: Assets\UnityTensorflow\Examples\3DBall\3DBallNECheckpoint.bytes
0 Bytes
Binary file not shown.
Binary file not shown.

Assets/UnityTensorflow/Examples/3DBall/3DBallNECheckpoint_NEData.bytes.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UnityTensorflow/Examples/Crawler.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.

0 commit comments

Comments
 (0)