Skip to content

Commit 92ba145

Browse files
author
Christiaan Bloemendaal
committed
Create README.md
1 parent 91c3992 commit 92ba145

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Unity3D-ComponentAttribute
2+
An attribute that let's you auto-load components
3+
4+
* Works on fields and properties
5+
* Load components on awake (ExtendedBehaviour only)
6+
* Disable component on error (optional)
7+
8+
9+
The way of ExtendedBehaviour
10+
---------------------------
11+
You can derive your custom behaviour from the ExtendedBehaviour class.
12+
13+
The only thing left to do is add the component attribute to fields or properties and you are ready to go.
14+
15+
![ExtendedBehaviour](http://puu.sh/lmyDs/ebeb03e5ad.png)
16+
17+
The downsides of using this way are (in my opinion)
18+
19+
1. You have to make your custom behaviour inherit from ExtendedBehaviour.
20+
2. If you want to use Awake() you have to override it instead of the standard definition.
21+
22+
The way of this.LoadComponents()
23+
--------------------------------
24+
Call *this.LoadComponents()* In the Start() or Awake() (or wherever you want to put it, really).
25+
26+
The only thing left to do is add the component attribute to fields or properties and you are ready to go.
27+
28+
![Extension](http://puu.sh/lmyB4/2b3e79b708.png)
29+
30+
The downsides of using this way are (in my opinion)
31+
32+
1. You have to call this.LoadComponents, which you might forget.
33+
2. I forget things fast, which makes point one worse.

0 commit comments

Comments
 (0)