void Start() { jumpingComponents = StaticUtilities.ReturnInterfacesFromComponentsAndAnyControllerStates <IJump>(gameObject); foreach (var jump in jumpingComponents) { jump.OnJump += DoAJump; } }
private void SetUpKnockInterface() { knockTargetsComponents = StaticUtilities.ReturnInterfacesFromComponentsAndAnyControllerStates <IKnockTarget>(gameObject); foreach (var knockTarget in knockTargetsComponents) { knockTarget.OnKnockTarget += KnockingTheTarget; } }
private void SetUpChangeDirectionInterfaces() { changeDirectionables = StaticUtilities.ReturnInterfacesFromComponentsAndAnyControllerStates <IChangeDirection>(gameObject); for (int i = 0; i < changeDirectionables.Length; i++) { IChangeDirection controller = changeDirectionables[i]; controller.OnChangeDirection += ChangeDirection; } }
private void SetUpDirectionUpdatables() { updateDirectionables = StaticUtilities.ReturnInterfacesFromComponentsAndAnyControllerStates <IDirectionUpdateable>(gameObject); }