예제 #1
0
    public void Init(
        KinimaticMotorController motorController,
        CameraController cameraController,
        HauntController hauntController,
        KeyBindingsController keyBindings,
        BarrierController barrierController,
        ActionLockController actionLockController
        )
    {
        var body = GetComponentInChildren <Rigidbody>();

        this.actionLockController = actionLockController;
        directionInput            = new InputDirectionController(keyBindings);
        motor         = motorController.GetMotor(motorConfig, body, directionInput);
        motorAnimator = new MotorAnimator(directionInput, GetComponentInChildren <Animator>(), walkStateName, idleStateName);
        cameraController.Follow(transform);
        haunter = new Haunter()
        {
            root = transform
        };
        hauntController?.AddHaunter(haunter);
        interactKey = keyBindings.GetKey(KeyAction.Interact);
        dimmer      = new ProximityDimmer()
        {
            root = transform, radius = dimRadius
        };
        builder = new BarrierBuilder()
        {
            root = transform
        };
        barrierController?.SetBuilder(builder);
    }
예제 #2
0
 private static DirectionalInputState getNewInputState(KeyBindingsController bindings, KeyAction action, MoveDirection direction)
 {
     return(new DirectionalInputState()
     {
         at = Stopwatch.GetTimestamp(), isPressed = false, direction = direction, key = bindings.GetKey(action)
     });
 }