private void CheckButtonInteraction(ref HitResult3D result) { ButtonComponentBase currentButton = null; if (result.Succeeded) { Entity entityHiting = (result.PhysicBody.UserData as PhysicBody3D).Owner; currentButton = entityHiting?.Parent?.FindComponent <ButtonComponentBase>(false); if (currentButton != null) { if (!currentButton.Hover) { currentButton.Hover = true; } if (this.TriggerValue > 0 && this.lastTriggerValue == 0) { currentButton?.Touch(); } if (currentButton != this.lastButton && this.lastButton != null) { this.lastButton.Hover = false; } } else { if (this.lastButton != null) { this.lastButton.Hover = false; } } } else { if (this.lastButton != null) { this.lastButton.Hover = false; } } this.lastButton = currentButton; }
private void Reset() { Button = GetComponent <ButtonComponentBase>(); }
private void Reset() { Button = GetComponentInChildren <ButtonComponentBase>(); }
private void Reset() { InvertReference = false; Button = GetComponentInChildrenAdvanced <ButtonComponentBase>(); }