Esempio n. 1
0
 public CustomInput(double interval = 1, Dispatcher dispatcher = null, DispatcherPriority priority = DispatcherPriority.Normal)
 {
     LockKeyStock          = new Dictionary <int, KeyData <KeySendType> >();
     inputTimer            = new InputTimer(Keys.LButton, interval, dispatcher, priority);
     inputTimer.MethodDown = () =>
     {
         if (!FlgNextUnLock)
         {
             if (LockKeyStock.Count > 0)
             {
                 FlgNextUnLock = true;
             }
         }
     };
     inputTimer.MethodUp = () =>
     {
         if (FlgNextUnLock)
         {
             FlgNextUnLock = false;
             foreach (var data in LockKeyStock)
             {
                 KeySend(data.Value);
             }
             LockKeyStock.Clear();
         }
     };
     inputTimer.Start();
 }
Esempio n. 2
0
 private void Awake()
 {
     _flying       = false;
     _audioManager = FindObjectOfType <AudioManager>();
     _inputTimer   = FindObjectOfType <InputTimer>();
     _inputTimer.ResetTimer();
     _audioManager.Play("Driving_" + _player);
     _smoke          = transform.Find("Smoke").GetComponent <ParticleSystem>();
     _crashParticles = transform.Find("CrashParticle").GetComponentsInChildren <ParticleSystem>();
     _smoke.Stop();
     for (int i = 0; i < _crashParticles.Length; i++)
     {
         _crashParticles[i].Stop();
     }
 }
Esempio n. 3
0
        public void userIdle()
        {
            while (true)
            {
                TimeSpan idleTime = InputTimer.GetInputIdleTime();
                if (idleTime.TotalSeconds >= 17)     // 10
                {
                    //send Message and ask if user went to break
                    while (InputTimer.GetInputIdleTime().TotalSeconds >= 17)      // 1
                    {
                        Thread.Sleep(1000);
                    }

                    string askIfUserWentToBreak = "Hello, you were idle, did you were on a break?";
                    if (onBreak == false)
                    {
                        doWhenMSGready(askIfUserWentToBreak, eQuery.idle);
                    }
                }
            }
        }
Esempio n. 4
0
    void Start()
    {
        LowPolyFish = _lowPolyFish;
        HookHit     = _hookHit;
        gameEnded   = false;
        SpawnBoat(_boatSpawn.position, _boatSetUp.position);
        SpawnHook();
        SpawnRadar();
        SpawnTrailer();

        Boat.AssignRadar(Radar);
        Hook.AssignBoat(Boat);


        //Debug.Log(_generals.Count + " generals");

        //InputTimer and basic should be on the same object, but I'm explictly calling in case they ever aren't
        //and therefore I can still get the script
        _inputTimer = GetComponent <InputTimer>(); if (!_inputTimer)
        {
            Debug.Log("ERROR: Cannot get a reference to InputTimer from the Manager object.");
        }
        GlobalUI = GetComponent <GlobalUI>(); if (!GlobalUI)
        {
            Debug.Log("ERROR: Cannot get a reference to GlobalUI from the Manager object.");
        }
        Scorehandler = GetComponent <ScoreHandler>(); if (!Scorehandler)
        {
            Debug.Log("ERROR: Cannot get reference to ScoreHandler from Manager object");
        }
        Shoppinglist = GetComponent <ShoppingList>(); if (!Shoppinglist)
        {
            Debug.Log("ERROR: Cannot get reference to ShoppingList from Manager object");
        }
        combo = GetComponent <Combo>(); if (!combo)
        {
            Debug.Log("ERROR: Cannot get reference to Combo from Manager object");
        }
        Gameplayvalues = GetComponent <GameplayValues>(); if (!Gameplayvalues)
        {
            Debug.Log("ERROR: Cannot get reference to GameplayValues from Manager object");
        }
        Tempfishspawn = GetComponent <FishSpawn>(); if (!Tempfishspawn)
        {
            Debug.Log("ERROR: Cannot get reference to TempFishSpawn from Manager object");
        }
        Camerahandler = GetComponent <CameraHandler>(); if (!Camerahandler)
        {
            Debug.Log("ERROR: Cannot get reference to CameraHandler from Manager object");
        }
        Seafloorspawning = GetComponent <SeafloorSpawning>(); if (!Seafloorspawning)
        {
            Debug.Log("ERROR: Cannot get reference to SeafloorSpawning from Manager object");
        }

        Camerahandler.InitializeCameraHandler();


        //Find out seaDepth
        floor = GameObject.FindGameObjectWithTag("Floor");
        Vector3 difference = floor.transform.position - Boat.transform.position;

        seaDepth = Mathf.Abs(difference.y) - floor.transform.lossyScale.y / 2;


        //Getting the position and size of the zone where the jellyfish can move
        _jellyfishZoneSizeX = _jellyfishZone.transform.localScale.x / 2;
        _jellyfishZonePosX  = _jellyfishZone.transform.position.x;
        _jellyfishZoneSizeY = _jellyfishZone.transform.localScale.y / 2;
        _jellyfishZonePosY  = _jellyfishZone.transform.position.y;
        //Find out seaWidth
        //_docks = GameObject.FindGameObjectWithTag("Docks"); if (!_docks) Debug.Log("WARNING (Jellyfish uses this): You need to create the Docks and tag it with Docks");
        //_endOfLevel = GameObject.FindGameObjectWithTag("EndOfLevel"); if (!_endOfLevel) Debug.Log("WARNING (Jellyfish uses this): You need to create an empy object, place it at the end of the level (x) and tag it with EndOfLevel");
        //_seaWidth = Vector3.Distance(_docks.transform.position, _endOfLevel.transform.position);
        //
    }