// Use this for initialization void Start() { mover = GetComponent <TopdownMover>(); Utility.Assert(mover != null); game = Utility.FindAncestor <TopdownGame>(gameObject); Utility.Assert(game != null); player = game.GetPlayer(); Utility.Assert(player != null); foreach (Attackable part in gameObject.GetComponentsInChildren <Attackable>()) { parts.Add(part); part.dieEvent.AddHandler(gameObject, OnPartDie); } }
// Use this for initialization void Start() { mover = GetComponent<TopdownMover>(); Utility.Assert( mover != null ); game = Utility.FindAncestor<TopdownGame>(gameObject); Utility.Assert( game != null ); player = game.GetPlayer(); Utility.Assert( player != null ); foreach( Attackable part in gameObject.GetComponentsInChildren<Attackable>() ) { parts.Add(part); part.dieEvent.AddHandler(gameObject, OnPartDie); } }
public void Init(Vector3 dir, string word, TopdownGame game) { this.dir = dir; this.word = word; this.game = game; }