void blink() { BlinkCounter++; Vector3 forwardDirection = transform.forward; Vector3 rightDirection = transform.right; Vector3 deltaPosition = Vector3.zero; if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.FORWARD)) { deltaPosition += (forwardDirection); } else if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.BACKWARD)) { deltaPosition -= (forwardDirection); } if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.RIGHT)) { deltaPosition += (rightDirection); } else if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.LEFT)) { deltaPosition -= (rightDirection); } if (deltaPosition.magnitude > 0.1f) { IsBlinking = true; BlinkingVelocity = deltaPosition * CharacterControllerParameters.Instance.BlinkingSpeed; OnBlink?.Invoke(); components.BlinkShadePostProcessEffect.StartEffect(); } }
Vector3 getMoveDirection() { Vector3 forwardDirection = parent.transform.forward; Vector3 rightDirection = parent.transform.right; Vector3 deltaPosition = Vector3.zero; BurinkeruInputManager inputManager = BurinkeruInputManager.Instance; if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.FORWARD)) { deltaPosition += (forwardDirection); } else if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.BACKWARD)) { deltaPosition -= (forwardDirection); } if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.RIGHT)) { deltaPosition += (rightDirection); } else if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.LEFT)) { deltaPosition -= (rightDirection); } deltaPosition.Normalize(); deltaPosition.Scale(new Vector3(1f, 0f, 1f)); return(deltaPosition); }