public PlayerAIBehavior(Entity ball) : base("PlayerIABehavior") { this.trans2D = null; this.ball = ball; this.transBall2D = ball.FindComponent<Transform2D>(); this.ballBehavior = ball.FindComponent<BallBehavior>(); this.direction = ballBehavior.HorizontalDirection; }
protected override void ResolveDependencies() { ball = (this.Scene as GameScene).EntityManager.Find <Entity>("Ball"); bg = (this.Scene as GameScene).EntityManager.Find <Entity>("Background"); ballBehavior = ball.FindComponent <BallBehavior>(); }
protected override void ResolveDependencies() { ball = (this.Scene as GameScene).EntityManager.Find<Entity>("Ball"); bg = (this.Scene as GameScene).EntityManager.Find<Entity>("Background"); ballBehavior = ball.FindComponent<BallBehavior>(); }