Beispiel #1
0
    private void Awake()
    {
        var root = transform.root;

        birdPhysics     = root.GetComponentInChildren <BirdPhysics>();
        collisionSensor = root.GetComponentInChildren <CollisionSensor>();
    }
Beispiel #2
0
    private void Awake()
    {
        birdPhysics     = transform.root.GetComponentInChildren <BirdPhysics>();
        collisionSensor = transform.root.GetComponentInChildren <CollisionSensor>();
        gameController  = GameObject.FindWithTag(Tags.GameController).GetComponent <GameController>();

        birdDeathEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <BirdDeathEventChannel>();
    }
Beispiel #3
0
    private void Awake()
    {
        this.birdPhysics            = birdPhysics ?? transform.root.GetComponentInChildren <BirdPhysics>();
        this.collisionSensor        = transform.root.GetComponentInChildren <CollisionSensor>();
        this.playerDiedEventChannel = GameObject.FindGameObjectWithTag(Tags.GameController).
                                      GetComponent <PlayerDiedEventChannel>();

        if (birdPhysics == null)
        {
            SayToLog("BirdPhysics component not found!");
        }
        if (collisionSensor == null)
        {
            SayToLog("CollisionSensor component not found!");
        }
    }
Beispiel #4
0
 /// <summary>
 /// Constructs a new Flappy Bird.
 /// </summary>
 /// <param name="type">The Bird Type.</param>
 public FlappyBird(BirdType type) : base(EntityType.BIRD, START_LOCATION, new Rectangle((int)START_LOCATION.X, (int)START_LOCATION.Y, 24, 24))
 {
     this.type       = type;
     this.physics    = new BirdPhysics();
     this.flapChange = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
 }
Beispiel #5
0
 private void Awake()
 {
     birdPhysics = transform.root.GetComponentInChildren <BirdPhysics>();
 }
 private void Awake()
 {
     translateMover = GetComponent <TranslateMover>();
     birdPhysics    = GetComponent <BirdPhysics>();
 }