Ejemplo n.º 1
0
    public override void OnShot(GameObject thisGO, GameObject shotByGO)
    {
        FlyController controller = shotByGO.GetComponent <Projectile>().controller;
        Bubble        bubble     = thisGO.GetComponent <Bubble>();

        controller?.OnIncreaseScore(controller.playerIndex, bubble.type.shootScore);
        controller?.OnHitBubble(thisGO.transform.position, bubble.type.shootScore);

        bubble.BeginDestroy();
    }
Ejemplo n.º 2
0
    public override void OnCollided(GameObject thisGO, GameObject collidedWithGO)
    {
        FlyController controller = collidedWithGO.GetComponent <FlyController>();

        if (controller)
        {
            controller?.OnDecreaseScore(controller.playerIndex, deductPoints);
            controller.flightSpeedVariable = slowDownVariable;
            controller.StartCoroutine(ResetSpeed(controller));
            controller?.OnHitBubble(thisGO.transform.position, -deductPoints);
        }
    }
Ejemplo n.º 3
0
    public override void OnCollided(GameObject thisGO, GameObject shotByGO)
    {
        // Increase speed
        FlyController controller = shotByGO.GetComponent <FlyController>();
        Bubble        bubble     = thisGO.GetComponent <Bubble>();

        controller?.OnIncreaseScore(controller.playerIndex, bubble.type.collideScore);
        controller?.OnHitBubble(thisGO.transform.position, bubble.type.collideScore);

        Debug.Log("collided with gas bub");

        bubble.BeginDestroy();
    }