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)); } } }
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; } }
private void Start() { parent = GetComponentInParent <ObstacleParent>(); }