Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        SantaUnit santaUnit = other.GetComponent <SantaUnit>();

        if (santaUnit != null)
        {
            santaUnit.CollectGift(this);
        }
    }
Пример #2
0
    private void OnDropAreaEnter(Collider collider)
    {
        SantaUnit santaUnit = collider.GetComponent <SantaUnit>();

        if (santaUnit != null)
        {
            List <Gift> deliveredGifts = santaUnit.DropGift(giftRequests);

            GiftDelivered(deliveredGifts);
        }
    }
Пример #3
0
    private void OnInfluenceExit(Collider other)
    {
        SantaUnit santaUnit = other.GetComponent <SantaUnit>();

        if (santaUnit == null || kidnap)
        {
            return;
        }

        pathFollower.enabled = true;
        chase.enabled        = false;
        chase.SetTarget(null);
    }
Пример #4
0
    private void OnInfluenceEnter(Collider other)
    {
        SantaUnit santaUnit = other.GetComponent <SantaUnit>();

        if (santaUnit == null)
        {
            return;
        }

        pathFollower.enabled = false;
        chase.enabled        = true;
        chase.SetTarget(santaUnit.transform);
    }
Пример #5
0
    private void OnKidnapped(SantaUnit santaUnit)
    {
        CameraController.Instance.OrbitCamera.SetTarget(null);

        int santaLeft = 0;

        foreach (SantaUnit item in santaUnits)
        {
            if (item.IsKidnapped() == false)
            {
                santaLeft++;
            }
        }
        gameInfoUI.UpdateSantaUnitLeft(santaLeft);
    }
Пример #6
0
    private void OnTriggerEnterAction(Collider other)
    {
        SantaUnit santaUnit = other.GetComponent <SantaUnit>();

        if (santaUnit == null)
        {
            return;
        }

        List <Vector3> path     = new List <Vector3>();
        Vector3        honolulu = GameController.Instance.Honolulu.position;

        path.Add(honolulu);
        pathFollower.SetPath(path);
        pathFollower.enabled = true;
        chase.enabled        = false;
        kidnap = true;

        santaUnit.Kidnapped(this);
        SelectionManager.Instance.Deselect(santaUnit);
    }
Пример #7
0
    private void OnGiftCollected(SantaUnit santaUnit, Gift gift)
    {
        ISelectable selectable = santaUnit.GetComponent <ISelectable>();

        giftSelectionUI.SetSelectable(selectable);
    }