示例#1
0
    private float timer;                                //广播计时器

    private void Start()
    {
        wheelInput  = WheelInput.Instance;
        wheelOffset = wheelInput.steeringWheel;

        DontDestroyOnLoad(gameObject);
    }
示例#2
0
        public static string processInput(WheelInput input)
        {
            int nTotal = input.wheel.Length;

            int initialState = 0;
            int holeCount = 0;
            for (int i = 0; i < nTotal; ++i)
            {
                if (input.wheel[i] == 'X') initialState = initialState.SetBit(i);
                if (input.wheel[i] == '.') holeCount++;

            }

            BigInteger denom = 1;

            for (int i = 0; i < holeCount; ++i)
                denom *= nTotal;

            DynamicProgramming dp = new DynamicProgramming(nTotal);

            BigInteger num = dp.calc(initialState, denom / nTotal);

            Logger.LogDebug(" {} / {} ", num, denom);

            return ((double)num / (double)denom).ToUsString(9);
        }
示例#3
0
    private void Awake()
    {
        _instance = this;
        LogitechGSDK.LogiSteeringInitialize(false); //外设初始化

        DontDestroyOnLoad(gameObject);              //加载不销毁
    }