Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Fish"))
        {
            Vibration.VibratePeek();

            var fishObj = other.gameObject;
            fishObj.transform.parent = transform;

            var fish = fishObj.GetComponent <Fish1>();
            fish.ShowText(_fishManager.transform);
            _caughtFish.Add(fish);
            ++_currentStrength;
            _UI.UpdateCurrentFish(_currentStrength);

            _fishManager.RemoveFish(fish);
            fish.CatchFish(transform.GetChild(0));

            other.enabled = false;
        }
    }