示例#1
0
    // Have external be listening for events- depending on the string attached?

    void Awake()
    {
        mv = GetComponent <MovementType>();
        hexQueuedMovement = GetComponent <HexQueuedCntrl>();
        discreteMovement  = GetComponent <DiscreteMovement>();
        hexhexControl     = GetComponent <HexToHexControl>();
        disQueuedMovement = GetComponent <QueuedControl>();
        turnControl       = GetComponent <TurnBasedControl>();
        simulatedControl  = GetComponent <SimulatedControl>();
        replayControl     = GetComponent <ReplayControl>();
    }
示例#2
0
 void Awake()
 {
     discreteQueued = GetComponent<QueuedControl>();
     continousControl = GetComponent<ContinuousControl>();
     hexesControl = GetComponent<HexToHexControl>();
     discreteControl = GetComponent<DiscreteMovement>();
     hexQueuedControl = GetComponent<HexQueuedCntrl>();
     turnControl = GetComponent<TurnBasedControl>();
     simulatedControl = GetComponent<SimulatedControl>();
     replayControl = GetComponent<ReplayControl>();
 }
示例#3
0
        protected override void OnUpdate()
        {
            float dt = Time.deltaTime;

            for (int i = 0; i < data.Length; i++)
            {
                PlayerInput input = data.Input[i];

                Position position = data.Position[i];
                Heading  heading  = data.Heading[i];

                position.Value += input.Movement * dt * BombariaBootstrap.Settings.playerMovementSpeed;
                heading.Value   = DiscreteMovement.GetHeadingXZDiscrete45(input.Movement);

                data.Heading[i]  = heading;
                data.Position[i] = position;
            }
        }
示例#4
0
    public override void UpdateAction(AIStateController controller)
    {
        controller.SetFloat(TIMER_KEY, controller.getFloat(TIMER_KEY) + Time.deltaTime);

        if (controller.getFloat(TIMER_KEY) >= controller.getFloat(CUR_TIME_BEFORE_DIR_CHANGE_KEY))
        {
            controller.SetFloat(STOP_TIMER_KEY, controller.getFloat(STOP_TIMER_KEY) + Time.deltaTime);

            if (controller.getFloat(STOP_TIMER_KEY) >= controller.getFloat(CUR_STOP_TIME_KEY))
            {
                Resume(controller);
            }
        }
        else
        {
            DiscreteMovement.MoveDiscrete(controller.GetRigidbody(), GetCurMovingDirection(controller), speed);
            DiscreteMovement.RotateDiscrete(controller.GetRigidbody(), GetCurMovingDirection(controller));
        }
    }
示例#5
0
 private void Rotate()
 {
     DiscreteMovement.RotateXZDiscrete45(rb, movement);
 }
示例#6
0
 public static void MoveDiscrete(Rigidbody rigidbody, DiscreteMovement.MovingDirection direction, float speed)
 {
     CommonUtils.Move(rigidbody, DiscreteMovement.GetDirectionVector(direction), speed);
 }
示例#7
0
 public static quaternion GetRotationXZDiscrete45(MovingDirection direction)
 {
     return(Quaternion.Euler(DiscreteMovement.GetRotationVector(direction)));
 }
示例#8
0
 public static float3 GetHeadingXZDiscrete45(float3 movement)
 {
     return(DiscreteMovement.GetRotationVector(GetMovingDirection(movement)));
 }