Last active
August 29, 2015 13:56
-
-
Save fum1h1ro/9223212 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
_ground_obj as GameObject = null | |
_ground as Ground = null | |
ground_obj: | |
get: | |
_ground_obj = GameObject.Find('Ground') if _ground_obj == null | |
return _ground_obj | |
ground: | |
get: | |
_ground = ground_obj.GetComponent[of Ground]() if _ground == null | |
return _ground |
This file contains hidden or 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
class Accessor[of T(MonoBehaviour)]: | |
_name as string | |
_obj as GameObject = null | |
_mono as T = null as T | |
public def constructor(name as string): | |
_name = name | |
public obj: | |
get: | |
_obj = GameObject.Find(_name) if _obj == null | |
return _obj | |
public mono: | |
get: | |
_mono = obj.GetComponent[of T]() if _mono == null | |
return _mono | |
class Thief(OreMonoBehaviour): | |
ground = Accessor[of Ground]('Ground') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ポカミス修正