Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D c)
    {
        BalloonPlayerController bpc = c.gameObject.GetComponent <BalloonPlayerController>();

        if (bpc != null)
        {
            bpc.ObstacleHit();
        }

        //Player and building vectors unnecessary as we dont use that data for clouds
        gameController.RecordCollision(new Vector2(), new Vector2(), true);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Registers collisions with the balloon and sends collision data back to game controller for recording
    /// </summary>
    /// <param name="c">Information about the collision that occured</param>
    void OnTriggerEnter2D(Collider2D c)
    {
        BalloonPlayerController bpc = c.gameObject.GetComponent <BalloonPlayerController>();

        if (bpc != null)
        {
            bpc.ObstacleHit();
        }

        float   xValue          = transform.position.x;
        float   yValue          = -1f * Camera.main.orthographicSize + totalBuildingHeight / 2.0f;
        Vector2 mockBuildingPos = new Vector2(xValue, yValue);

        gameController.RecordCollision(mockBuildingPos, c.gameObject.transform.position, false);
    }