Exemplo n.º 1
0
    private void OnTriggerExit(Collider other)
    {
        GameObject otherGo = other.gameObject;

        if (((1 << otherGo.layer) & interactableLayers) != 0)
        {
            _actualInteractableMachine.PlayerOnTrigger(_model, false);
            _actualInteractableMachine = null;
            _model.CanShop(false);
        }
    }
Exemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        GameObject otherGo = other.gameObject;

        if (((1 << otherGo.layer) & IAgressiveLayers) != 0)
        {
            otherGo.GetComponent <IAgressive>().Hit();
            _owner.ReceiveDamage(otherGo.GetComponent <IAgressive>().GetDamage(),
                                 (transform.position - otherGo.transform.position) * otherGo.GetComponent <IAgressive>().GetAgressiveness()
                                 + Vector3.up * (otherGo.GetComponent <IAgressive>().GetAgressiveness()) * 0.5f);
        }
        if (((1 << otherGo.layer) & interactableLayers) != 0)
        {
            _model.CanShop(true);
            _actualInteractableMachine = otherGo.GetComponent <InteractableMachine>();
            _actualInteractableMachine.PlayerOnTrigger(_model, true);
        }
    }