public static Targeter Create() { GameObject g = new GameObject("targeting root", typeof(Targeter)); Targeter t = g.GetComponent <Targeter>(); t.IsVisible = false; return(t); }
//TODO: make this not pass in a SquareMovement but rather an interface exposing only position //TODO: pass an "attack" object in here, to trigger public Projectile(Targeter targeter, SquareMovement source, GameObject visualPrefab) { if (targeter == null) throw new ArgumentNullException("targeter"); if (targeter.IsVisible) throw new ArgumentException("The given targeter must not already be active."); this.targeter = targeter; this.targeter.Selected += HandleTargetSelected; this.visualPrefab = visualPrefab; this.source = source; }
//TODO: make this not pass in a SquareMovement but rather an interface exposing only position //TODO: pass an "attack" object in here, to trigger public Projectile(Targeter targeter, SquareMovement source, GameObject visualPrefab) { if (targeter == null) { throw new ArgumentNullException("targeter"); } if (targeter.IsVisible) { throw new ArgumentException("The given targeter must not already be active."); } this.targeter = targeter; this.targeter.Selected += HandleTargetSelected; this.visualPrefab = visualPrefab; this.source = source; }