Exemplo n.º 1
0
    public void UpdateWithInput(Inputs inputs)
    {
        if (inputs.Punch)
        {
            if (CanUsePunch())
            {
                animator.SetTrigger("Punch");
                Collider[] hitColliders = Physics.OverlapSphere(transform.position + sphereOverlapOffset, sphereOverlapRadius, layerMask);

                foreach (var hitCollider in hitColliders)
                {
                    ObstacleParent o = hitCollider.GetComponent <ObstacleParent>();
                    if (o)
                    {
                        o.Dispose(false);
                    }
                    //Debug.Log(hitCollider.transform.position);
                    break;
                }
                canPunch            = false;
                punchSprite.enabled = CanUsePunch();
                _ = StartCoroutine(nameof(StartPunchCooldown));
            }
        }
    }
Exemplo n.º 2
0
    private void ClientResetColliders()
    {
        var method = MethodBase.GetCurrentMethod();
        var attr   = (ClientAccess)method.GetCustomAttributes(typeof(ClientAccess), true)[0];

        if (!attr.HasAccess)
        {
            return;
        }

        var colliders = ObstacleParent.GetComponentsInChildren <Collider>();

        foreach (var collider1 in colliders)
        {
            collider1.enabled = true;
        }
    }
Exemplo n.º 3
0
 private void Start()
 {
     parent = GetComponentInParent <ObstacleParent>();
 }