Exemplo n.º 1
0
    void Awake()
    {
        ItsRandom.setRandomSeed(1234567890, "bags");
        ItsRandom.setRandomSeed(987654321, "people");

        // "Download" people config - TODO - this should be done elsewhere, preloaded per mission
        string peopleConfigUrl = "http://samlingar.com/whatareyoucarryingsir/example-people-config-2.xml";

        StartCoroutine(loadPeopleConfig(peopleConfigUrl));

        // Set framerate only for editor - Should do based on device later?!
//#if UNITY_EDITOR
        QualitySettings.vSyncCount  = 0; // VSync must be disabled
        Application.targetFrameRate = 90;
//#endif

        Game.instance = this;
        CameraHandler.SetPerspectiveCamera(gameCamera);

        swipeRecognizer         = new TKSwipeRecognizer();
        twoTapRecognizer        = new TKTapRecognizer();
        tapRecognizer           = new TKTapRecognizer();
        continousHoldRecognizer = new TKContinousHoldRecognizer();

        // Last in line for click triggering
        PubSub.subscribe("Click", this, Int32.MaxValue);

        pauseGame(true);
    }
Exemplo n.º 2
0
 void touchHoldEnded(TKContinousHoldRecognizer r)
 {
     if (r.touchCount == 1)
     {
         BagHandler.instance.zoomInspectItem(false);
     }
 }
Exemplo n.º 3
0
    private static IEnumerator CheckContinousHold(TKContinousHoldRecognizer holdRecognizer)
    {
        while (holdRecognizer.startTime <= Time.time)
        {
            yield return(null);

//            Debug.Log("running");
            if (Time.time > holdRecognizer.startTime + holdRecognizer._maxDurationForTapConsideration)
            {
                holdRecognizer.fireHoldingEvent();
            }
        }
    }
Exemplo n.º 4
0
 void touchHoldActive(TKContinousHoldRecognizer r)
 {
     if (r.touchCount == 2)
     {
         BagHandler.instance.moveConveyor(-CONVEYOR_SPEED * CONVEYOR_BACK_PCT_SPEED, currentXrayMachine);
     }
     else if (r.touchCount == 1)
     {
         BagHandler.instance.moveConveyor(CONVEYOR_SPEED, currentXrayMachine);
         if (r.firstFrame)
         {
             BagHandler.instance.zoomInspectItem(true, r.maxTouchMovement);
         }
         else
         {
             BagHandler.instance.potentiallyStopZoomInspectItem(r.maxTouchMovement);
         }
     }
 }