private void Query(ref BaseUnitStatus.Component status,
                           ref AdvancedUnmannedInput.Component unMannedInput,
                           ref AdvancedUnitController.Component controller,
                           ref LocalController local)
        {
            if (status.State != UnitState.Alive)
            {
                return;
            }

            var inter = unMannedInput.Interval;

            if (CheckTime(ref inter) == false)
            {
                return;
            }

            unMannedInput.Interval = inter;
            var x           = UnityEngine.Random.Range(-1.0f, 1.0f);
            var y           = UnityEngine.Random.Range(-1.0f, 1.0f);
            var isShiftDown = false; //Input.GetKey(KeyCode.LeftShift);
            var isJump      = false; //Input.GetKey(KeyCode.Space);
            var action      = local.Action;
            var stick       = local.Stick;

            if (CommonUpdate(new Vector2(x, y), new Vector2(x, y), isShiftDown, isJump, false, false, ref stick, ref action))
            {
                controller.Action = action;
            }

            local.Action = action;
            local.Stick  = stick;
        }
Beispiel #2
0
        private void Query(ref BaseUnitStatus.Component status,
                           ref AdvancedUnitController.Component controller)
        {
            if (status.State != UnitState.Alive)
            {
                return;
            }

            // action
        }
        private void Query(ref CameraTransform cameraTransform,
                           ref AdvancedUnitController.Component unitController,
                           ref LocalController local)
        {
            var input       = InputUtils.GetMove();
            var inputCam    = InputUtils.GetCamera();
            var isShiftDown = Input.GetKey(KeyCode.LeftShift);
            var isJump      = Input.GetKey(KeyCode.Space);
            var action      = local.Action;
            var stick       = local.Stick;

            if (CommonUpdate(input, inputCam, isShiftDown, isJump, false, false, ref stick, ref action))
            {
                unitController.Action = action;
            }

            local.Stick  = stick;
            local.Action = action;
        }