Skip to content

Commit 9a6bb7f

Browse files
committed
Add package manifest for UPM, Add package documentation
1 parent 388d8b0 commit 9a6bb7f

File tree

12 files changed

+202
-13
lines changed

12 files changed

+202
-13
lines changed

Assets/Plugins/Excalith/Observer/Documentation.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: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Unity Observer
2+
### Observer Editor Window
3+
4+
An editor window to invoke methods, observe values and change them on editor play mode.
5+
6+
7+
## Usage
8+
- You can open Observer window through `Window > Tools > Observer`
9+
- Requires `Excalith.Observer` namespace
10+
11+
| Function | Argument 1 | Argument 2 | Argument 3 |
12+
| ------------------ | ----------------- | -------------------- | --------------- |
13+
| Observer.Log | `string` Category | `string` DisplayName | `object` Object |
14+
| Observer.Value | `string` Category | `string` DisplayName | `object` Object |
15+
| Observer.Button | `string` Category | `string` DisplayName | `object` Object |
16+
| Observer.Header | `string` Category | `string` DisplayName | `string` Title |
17+
| Observer.Seperator | `string` Category | | |
18+
---
19+
20+
### Log Method
21+
Registers a value to watch over. To update values, call corresponding function again.
22+
23+
```C
24+
Observer.Log("Log Examples", "String Value", "Test String");
25+
Observer.Log("Log Examples", "Boolean Value", true);
26+
Observer.Log("Log Examples", "Int Value", 150);
27+
Observer.Log("Log Examples", "Float Value", 1.50f);
28+
Observer.Log("Log Examples", "Double Value", 1.50);
29+
Observer.Log("Log Examples", "Vector2 Value", new Vector2(2,2));
30+
Observer.Log("Log Examples", "Vector3 Value", new Vector3(2, 2, 2));
31+
Observer.Log("Log Examples", "Color Value", new Color(128, 128, 128));
32+
Observer.Log("Log Examples", "Enum Value", MyEnum.MyValue);
33+
```
34+
35+
---
36+
37+
### Value Method
38+
> FYI: This should be only used within editor for testing purposes
39+
Registers a value and allows you to update it through editor. Unsupported objects will be shown as "Unsupported Type".
40+
41+
```C
42+
// Boolean Example
43+
Observer.Value("Update Examples", "Boolean Type", m_BoolTest, (object val) =>
44+
{
45+
m_BoolTest = (bool)val;
46+
});
47+
48+
// String Example
49+
Observer.Value("Update Examples", "String Type", m_StringTest, (object val) =>
50+
{
51+
m_StringTest = (string)val;
52+
});
53+
54+
// Integer Example
55+
Observer.Value("Update Examples", "Integer Type", m_IntTest, (object val) =>
56+
{
57+
m_IntTest = (int)val;
58+
});
59+
60+
// Float Example
61+
Observer.Value("Update Examples", "Float Type", m_FloatTest, (object val) =>
62+
{
63+
m_FloatTest = (float)val;
64+
});
65+
66+
// Double Example
67+
Observer.Value("Update Examples", "Double Type", m_DoubleTest, (object val) =>
68+
{
69+
m_DoubleTest = (double)val;
70+
});
71+
72+
// Vector2 Example
73+
Observer.Value("Update Examples", "Vector2 Type", m_Vec2Test, (object val) =>
74+
{
75+
m_Vec2Test = (Vector2)val;
76+
});
77+
78+
// Vector3 Example
79+
Observer.Value("Update Examples", "Vector3 Type", m_Vec3Test, (object val) =>
80+
{
81+
m_Vec3Test = (Vector3)val;
82+
});
83+
84+
// Color Example
85+
Observer.Value("Update Examples", "Color Type", m_ColorTest, (object val) =>
86+
{
87+
m_ColorTest = (Color)val;
88+
});
89+
90+
// Enum Example
91+
Observer.Value("Update Examples", "Enum Type", m_EnumTest, (object val) =>
92+
{
93+
m_EnumTest = (ObserverEntryType)val;
94+
});
95+
```
96+
97+
---
98+
99+
#### Button Method
100+
Registers a button and invokes given function
101+
```C
102+
Observer.Button("Button Examples", "Function Call Button", TestFunction);
103+
```
104+
105+
```C
106+
Observer.Button("Button Examples", "Anonymous Call Button", () =>
107+
{
108+
Debug.Log("Hello, World!");
109+
});
110+
```
111+
112+
---
113+
114+
#### Header Method
115+
Creates a space with a title
116+
```C
117+
Observer.Header("Update Examples", "Header Example");
118+
```
119+
120+
---
121+
122+
#### Seperator Method
123+
Creates an empty space
124+
```C
125+
Observer.Seperator("Update Examples");
126+
```
127+
128+
## Contribution
129+
Please feel free to contribute!
130+
131+
- Create issues for both issues and feature requests
132+
- Create pull requests to develop for anything listed in issues
133+
- Please use prefixes such as Add, Fix, Update etc. before your commit message
134+
- Please be brief about your commit message
135+
136+
137+
## License
138+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

Assets/Plugins/Excalith/Observer/Documentation/README.md.meta

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

Assets/Plugins/Excalith/Observer/Samples/DemoScene.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/Plugins/Excalith/Observer/Examples/ObserverExamples.cs renamed to Assets/Plugins/Excalith/Observer/Samples/DemoScene/ObserverSamples.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using UnityEngine;
22

3-
namespace Excalith.Observer.Examples
3+
namespace Excalith.Observer.Samples
44
{
5-
public class ObserverExamples : MonoBehaviour
5+
public class ObserverSamples : MonoBehaviour
66
{
77
private string m_StringTest = "Test Value";
88
private bool m_BoolTest = true;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "com.excalith.unity-observer",
3+
"displayName": "Unity Observer",
4+
"version": "0.9.1",
5+
"unity": "2017.4",
6+
"description": "An editor window to invoke methods, observe values and change them on editor play mode.",
7+
"author": {
8+
"name": "Can Cellek",
9+
"url": "https://cancellek.com"
10+
},
11+
"keywords": [ "editor", "window", "debug", "log", "observer" ],
12+
"category": "editor extensions",
13+
"dependencies": {},
14+
"samples": [
15+
{
16+
"displayName": "Sample Scene",
17+
"description": "Scene with Unity Observer package usage examples",
18+
"path": "Samples~/DemoScene"
19+
}
20+
]
21+
}

Assets/Plugins/Excalith/Observer/package.json.meta

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

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Observer
2-
### Observer Editor Tool
1+
# Unity Observer
2+
### Observer Editor Window
33

44
An editor window to invoke methods, observe values and change them on editor play mode.
55

@@ -26,15 +26,15 @@ An editor window to invoke methods, observe values and change them on editor pla
2626
Registers a value to watch over. To update values, call corresponding function again.
2727

2828
```C
29-
Observer.Log("Observe Examples", "String Value", "Test String");
30-
Observer.Log("Observe Examples", "Boolean Value", true);
31-
Observer.Log("Observe Examples", "Int Value", 150);
32-
Observer.Log("Observe Examples", "Float Value", 1.50f);
33-
Observer.Log("Observe Examples", "Double Value", 1.50);
34-
Observer.Log("Observe Examples", "Vector2 Value", new Vector2(2,2));
35-
Observer.Log("Observe Examples", "Vector3 Value", new Vector3(2, 2, 2));
36-
Observer.Log("Observe Examples", "Color Value", new Color(128, 128, 128));
37-
Observer.Log("Observe Examples", "Enum Value", MyEnum.MyValue);
29+
Observer.Log("Log Examples", "String Value", "Test String");
30+
Observer.Log("Log Examples", "Boolean Value", true);
31+
Observer.Log("Log Examples", "Int Value", 150);
32+
Observer.Log("Log Examples", "Float Value", 1.50f);
33+
Observer.Log("Log Examples", "Double Value", 1.50);
34+
Observer.Log("Log Examples", "Vector2 Value", new Vector2(2,2));
35+
Observer.Log("Log Examples", "Vector3 Value", new Vector3(2, 2, 2));
36+
Observer.Log("Log Examples", "Color Value", new Color(128, 128, 128));
37+
Observer.Log("Log Examples", "Enum Value", MyEnum.MyValue);
3838
```
3939

4040
---

0 commit comments

Comments
 (0)