Наследование: MonoBehaviour
Пример #1
0
    void Start()
    {
        SoundManager.global.PlayDoorClose();

        // TODO: Can move this to a script object
        touchControls = FindObjectOfType <TouchControls>();
    }
    void Start()
    {
        // Initializers
        aspectUtil = FindObjectOfType <Camera>().GetComponent <AspectUtility>();
        dArrow     = GameObject.Find("Dialogue_Arrow");
        dBox       = GameObject.Find("Dialogue_Box");
        dFrame     = GameObject.Find("Dialogue_Frame").GetComponent <Image>();
        dText      = GameObject.Find("Dialogue_Text").GetComponent <Text>();
        dPic       = GameObject.Find("Dialogue_Picture").GetComponent <Image>();
        imgStrobe  = GameObject.Find("Dialogue_Arrow").GetComponent <ImageStrobe>();
        mainCamera = FindObjectOfType <CameraFollow>();
        oMan       = FindObjectOfType <OptionsManager>();
        pause      = FindObjectOfType <PauseGame>();
        pMove      = FindObjectOfType <PlayerMovement>();
        SFXMan     = FindObjectOfType <SFXManager>();
        touches    = FindObjectOfType <TouchControls>();
        uMan       = FindObjectOfType <UIManager>();

        bDialogueActive = false;
        bPauseDialogue  = false; // UX -- Prevents immediately reopening a dialogue while moving / talking
        pauseTime       = 0.333f;

        dArrowPoints = new float[4];
        dFramePoints = new float[4];
        dPicPoints   = new float[4];
        dTextPoints  = new float[4];

        ConfigureParameters();
    }
Пример #3
0
        public override void AddStandardControls(ControlSetup setup)
        {
            base.AddStandardControls(setup);

            for (var i = 0; i < kMaxConcurrentTouches; ++i)
            {
                var controls = new TouchControls();
                m_TouchControls.Add(controls);

                var prefix = "Touch " + i;
                controls.isDown    = (ButtonControl)setup.AddControl(SupportedControl.Get <ButtonControl>(prefix));
                controls.fingerId  = (DiscreteStatesControl)setup.AddControl(SupportedControl.Get <DiscreteStatesControl>(prefix + " ID"));
                controls.position  = (Vector2Control)setup.AddControl(SupportedControl.Get <Vector2Control>(prefix + " Position"));
                controls.positionX = (AxisControl)setup.AddControl(SupportedControl.Get <AxisControl>(prefix + " Position X"));
                controls.positionY = (AxisControl)setup.AddControl(SupportedControl.Get <AxisControl>(prefix + " Position Y"));
                controls.delta     = (Vector2Control)setup.AddControl(SupportedControl.Get <Vector2Control>(prefix + " Delta"));
                controls.deltaX    = (DeltaAxisControl)setup.AddControl(SupportedControl.Get <DeltaAxisControl>(prefix + " Delta X"));
                controls.deltaY    = (DeltaAxisControl)setup.AddControl(SupportedControl.Get <DeltaAxisControl>(prefix + " Delta Y"));
                controls.radius    = (Vector2Control)setup.AddControl(SupportedControl.Get <Vector2Control>(prefix + " Radius"));
                controls.radiusX   = (AxisControl)setup.AddControl(SupportedControl.Get <AxisControl>(prefix + " Radius X"));
                controls.radiusY   = (AxisControl)setup.AddControl(SupportedControl.Get <AxisControl>(prefix + " Radius Y"));
                controls.pressure  = (AxisControl)setup.AddControl(SupportedControl.Get <AxisControl>(prefix + " Pressure"));
            }

            setup.GetControl(CommonControls.DoubleClick).name = "Double Tap";
            setup.GetControl(CommonControls.Action1).name     = "One Finger";
            setup.GetControl(CommonControls.Action2).name     = "Two Fingers";
        }
Пример #4
0
    void Start()
    {
        // Initializers
        pauseMenu   = GameObject.Find("PauseScreen").transform;
        pauseScreen = GameObject.Find("PauseScreen").transform;
        scene       = SceneManager.GetActiveScene();
        touches     = FindObjectOfType <TouchControls>();

        CollumBtn   = GameObject.Find("Colluminac").GetComponent <Button>();
        ControlsBtn = GameObject.Find("Controls").GetComponent <Button>();
        GoOnBtn     = GameObject.Find("GoOn").GetComponent <Button>();
        IconsBtn    = GameObject.Find("Icons").GetComponent <Button>();
        MyCardBtn   = GameObject.Find("MyCard").GetComponent <Button>();
        QuitBtn     = GameObject.Find("Quit").GetComponent <Button>();
        ResetBtn    = GameObject.Find("Reset").GetComponent <Button>();
        SoundBtn    = GameObject.Find("Sound").GetComponent <Button>();

        CollumArw   = GameObject.Find("ColluminacArw");
        ControlsArw = GameObject.Find("ControlsArw");
        GoOnArw     = GameObject.Find("GoOnArw");
        IconsArw    = GameObject.Find("IconsArw");
        MyCardArw   = GameObject.Find("MyCardArw");
        QuitArw     = GameObject.Find("QuitArw");
        ResetArw    = GameObject.Find("ResetArw");
        SoundArw    = GameObject.Find("SoundArw");

        currentPosition = ArrowPos.GoOn;
    }
Пример #5
0
 //public Vector2 vector2;
 // Use this for initialization
 void Start()
 {
     anim          = GetComponent <Animator> ();
     myRigidbody2D = GetComponent <Rigidbody2D> ();
     onLadder      = false;
     gravityStore  = myRigidbody2D.gravityScale;
     touchControl  = GetComponent <TouchControls> ();
 }
Пример #6
0
 // Use this for initialization
 public override void Start()
 {
     base.Start();
     facingRight   = true;
     spRndrer      = GetComponent <SpriteRenderer>();
     levelManager  = FindObjectOfType <LevelManager> ();
     touchControls = FindObjectOfType <TouchControls> ();
 }
Пример #7
0
 private void Start()
 {
     arOrigin      = FindObjectOfType <ARSessionOrigin>();
     arRaycast     = FindObjectOfType <ARRaycastManager>();
     touchControls = GetComponent <TouchControls>();
     save          = GetComponent <Save>();
     raycastLine   = raycastIndicator.GetComponent <LineRenderer>();
 }
Пример #8
0
 void Start()
 {
     bounds        = GetComponent <RectTransform>();
     touchControls = GetComponent <TouchControls>();
     if (leftControlGuide)
     {
         leftControlGuide.gameObject.SetActive(false);
     }
 }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        playerHealth    = FindObjectOfType <Health>();
        playerMoveSpeed = FindObjectOfType <TouchControls>();

        lonesome = FindObjectOfType <Lonesome>();
        bulwark  = FindObjectOfType <Bulwark>();
        dreamer  = FindObjectOfType <Dreamer>();
    }
Пример #10
0
    void Start()
    {
        // Initializers
        contOpacCan    = GameObject.Find("GUIControls").GetComponent <CanvasGroup>();
        contOpacSlider = GameObject.Find("ShowButtonsSlider").GetComponent <Slider>();
        conTog         = GameObject.Find("ShowButtonsToggle").GetComponent <Toggle>();
        dHUD           = GameObject.Find("Dialogue_HUD").GetComponent <Canvas>();
        dMan           = FindObjectOfType <DialogueManager>();
        HUD            = GetComponent <Canvas>();
        hudCanvas      = GetComponent <CanvasGroup>();
        mainCamera     = FindObjectOfType <Camera>().GetComponent <Camera>();
        oMan           = FindObjectOfType <OptionsManager>();
        pauseButtOpac  = GameObject.Find("Pause_Button_Opacity");
        touches        = FindObjectOfType <TouchControls>();

        controlsMenu = GameObject.Find("ControlsMenu").GetComponent <RectTransform>();
        pauseMenu    = GameObject.Find("PauseMenu").GetComponent <RectTransform>();
        soundMenu    = GameObject.Find("SoundMenu").GetComponent <RectTransform>();
        iconsMenu    = GameObject.Find("IconsMenu").GetComponent <RectTransform>();

        // Sets initial activation off saved data (or transfer, which always saves UI)
        // In other words, this first IF only occurs on Chp0 - New Game
        if (!PlayerPrefs.HasKey("ControlsActive"))
        {
            CheckIfMobile();
        }
        else
        {
            if (PlayerPrefs.GetInt("ControlsActive") == 1)
            {
                DisplayControls();
            }
            else
            {
                HideControls();
            }
        }

        // Sets initial opacity based off saved data (or transfer, which always saves UI)
        // In other words, this first IF only occurs on Chp0 - New Game
        if (!PlayerPrefs.HasKey("ControlsOpac"))
        {
            currentContOpac      = 1.0f;
            contOpacSlider.value = 1.0f;
            contOpacCan.alpha    = 1.0f;
        }
        else
        {
            currentContOpac      = PlayerPrefs.GetFloat("ControlsOpac");
            contOpacSlider.value = currentContOpac;
            contOpacCan.alpha    = currentContOpac;
        }

        // Sets menu position based off scene
        CheckAndSetMenus();
    }
Пример #11
0
    void Start()
    {
        PlayerData playerData = LoadPlayer();

        scoreManager     = GameObject.Find("Score Manager").GetComponent <ScoreManager>();
        moneyManager     = GameObject.Find("Money Manager").GetComponent <MoneyManager>();
        touchControls    = GameObject.Find("Touch Controls").GetComponent <TouchControls>();
        playerHighScore  = playerData.highScore;
        playerTotalCoins = playerData.coinsCollected;
    }
 private void Start()
 {
     scoreScript  = FindObjectOfType <ScoreScript>();
     ThisCollider = GetComponent <Collider2D>();
     Shakey       = FindObjectOfType <ScreenShake>();
     BGTimer      = FindObjectOfType <BackgroundTimingScript>();
     MainText     = FindObjectOfType <ScrollingScript>();
     player       = FindObjectOfType <AnimatiePlayer>();
     Controls     = FindObjectOfType <TouchControls>();
 }
Пример #13
0
        private void Awake()
        {
            Score       = 0;
            _isGameOver = false;

            _controls = new TouchControls();

            _controls.Core.Fire.started += OnTouchScreenTap;
            _controls.Enable();
        }
Пример #14
0
    // *****************************************************
    // Touch Controls
    // *****************************************************

    private void initTouchControls()
    {
        touchControls = GameObject.Find("TouchControls").GetComponent <TouchControls>();
        touchLayer    = touchControls.getLayer("grid");

        touchLayer.onPress   += onTouchPress;
        touchLayer.onRelease += onTouchRelease;
        touchLayer.onMove    += onTouchMove;
        touchLayer.onSwipe   += onTouchSwipe;
    }
Пример #15
0
    void Start()
    {
        // Initializers
        playerCollider = GetComponent <PolygonCollider2D>();
        rBody          = GetComponent <Rigidbody2D>();
        touches        = FindObjectOfType <TouchControls>();
        trans          = GetComponent <Transform>();

        bGWCUpdate = true;

        moveSpeed = 1.0f;
    }
Пример #16
0
    void Start()
    {
        activePlayer = 0;
        difficulty   = 1f;
        turn         = 1;
        GameStep     = GameState.B_PreTurn;

        //initializing access
        TDPatternManager = GameObject.Find("DanceFloor").GetComponent <PatternManager>();
        TDTouchControls  = GameObject.Find("TouchControls").GetComponent <TouchControls>();
        TDTimeManager    = GameObject.Find("Canvas").GetComponent <TimeManager>();
    }
Пример #17
0
    void Start()
    {
        //instantiating other scripts to access them.
        PMTimeManager   = GameObject.Find("Canvas").GetComponent <TimeManager>();
        PMTextManager   = GameObject.Find("Canvas").GetComponent <TextManager>();
        PMTurnDirector  = GameObject.Find("TurnDirector").GetComponent <TurnDirector>();
        PMTouchControls = GameObject.Find("TouchControls").GetComponent <TouchControls>();

        //initializing the touches lists
        mainPattern   = new List <PlayerTouch>();
        repeatPattern = new List <PlayerTouch>();

        //instantiating the temporary player
        me = new Player(1, "Andre`", 2);
    }
Пример #18
0
    void Start()
    {
        // enemyHealth = FindObjectOfType<EnemyHealthOne>();
        // knockbackCount = 0f;

        fingerCount = 0;

        startSwipe = false;

        facingRight = true;

        anim = GetComponent <Animator>();

        platform            = FindObjectOfType <MovingPlatform>();
        levelLoader         = FindObjectOfType <LevelLoader>();
        touchControlsToFlip = FindObjectOfType <TouchControls>();
    }
Пример #19
0
    void Start()
    {
        // Initializers
        aUtil      = FindObjectOfType <AspectUtility>();
        dMan       = FindObjectOfType <DialogueManager>();
        gwc        = FindObjectOfType <GWC001>();
        mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        pause      = GameObject.Find("PauseScreen");
        pMove      = FindObjectOfType <PlayerMovement>();
        touches    = FindObjectOfType <TouchControls>();

        maxDoubleTapTime     = 0.333f;
        perspectiveZoomSpeed = 0.1f;       // The rate of change of the field of view in perspective mode.
        orthoZoomSpeed       = 0.0125f;    // The rate of change of the orthographic size in orthographic mode.
        speed    = 0.05f;
        tapCount = 0;

        bReadyToPan = true;
    }
Пример #20
0
    void Start()
    {
        // Initializers
        Opt1Btn = GameObject.Find("Opt1").GetComponent <Button>();
        Opt2Btn = GameObject.Find("Opt2").GetComponent <Button>();
        Opt3Btn = GameObject.Find("Opt3").GetComponent <Button>();
        Opt4Btn = GameObject.Find("Opt4").GetComponent <Button>();

        Opt1Arw = GameObject.Find("Opt1Arw");
        Opt2Arw = GameObject.Find("Opt2Arw");
        Opt3Arw = GameObject.Find("Opt3Arw");
        Opt4Arw = GameObject.Find("Opt4Arw");

        oMan        = FindObjectOfType <OptionsManager>();
        pauseScreen = GameObject.Find("PauseScreen");
        touches     = FindObjectOfType <TouchControls>();

        currentPosition = ArrowPos.Opt1;
    }
Пример #21
0
    void Start()
    {
        // Initializers
        scene = SceneManager.GetActiveScene();

        if (scene.name == "MainMenu")
        {
            savedVol = FindObjectOfType <VolumeManager>();
        }
        else
        {
            camFollow   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraFollow>();
            savedCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
            savedPlayer = GameObject.FindGameObjectWithTag("Player");
            savedVol    = FindObjectOfType <VolumeManager>();
            touches     = FindObjectOfType <TouchControls>();
            uMan        = FindObjectOfType <UIManager>();
        }
    }
Пример #22
0
    void Start()
    {
        // Initializers
        controlsMenu = GameObject.Find("ControlsMenu").transform;
        dMan         = FindObjectOfType <DialogueManager>();
        iconsMenu    = GameObject.Find("IconsMenu").transform;
        movePArw     = GameObject.Find("PauseMenu").GetComponent <MovePauseMenuArrow>();
        oMan         = FindObjectOfType <OptionsManager>();
        pauseMenu    = GameObject.Find("PauseMenu").transform;
        pauseTrans   = GameObject.Find("PauseScreen").GetComponent <Transform>();
        pMove        = FindObjectOfType <PlayerMovement>();
        soundMenu    = GameObject.Find("SoundMenu").transform;
        touches      = FindObjectOfType <TouchControls>();

        // Hide submenus to allow Update-Pause-Escape action
        controlsMenu.transform.localScale = Vector3.zero;
        iconsMenu.transform.localScale    = Vector3.zero;
        soundMenu.transform.localScale    = Vector3.zero;
    }
Пример #23
0
    public IEnumerator ResetGame()
    {
        finishFinished = false;

        TouchControls.LockControls();

        StartCoroutine(Fade(fadeImage, 1f, 1));

        yield return(new WaitForSeconds(1));

        letterbox.Deactivate();

        yield return(new WaitForSeconds(1));

        gameFinished = false;
        TouchControls.controlsLocked = false;

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
Пример #24
0
    void Start()
    {
        // Initializers
        dMan     = FindObjectOfType <DialogueManager>();
        gwc      = FindObjectOfType <GWC001>();
        mTouches = FindObjectOfType <MobileTouchControls>();
        pause    = GameObject.Find("Game_Controller").GetComponent <PauseGame>();
        spLogic  = FindObjectOfType <SinglePlayerLogic>();
        tileChar = gameObject.transform.GetChild(2);
        tileFlag = gameObject.transform.GetChild(3);
        tileIcon = gameObject.transform.GetChild(0);
        tileName = gameObject.transform.GetChild(1);
        touches  = FindObjectOfType <TouchControls>();
        uMan     = FindObjectOfType <UIManager>();

        bShowChar = true;
        bShowFlag = true;
        bShowIcon = true;
        bShowName = true;
    }
    public GameObject GoalObj;     //--for cheating

    void Awake()
    {
        rb = GetComponent <Rigidbody2D>();
        GameObject SceneControllerObj = GameObject.Find("SceneController");

        TouchControls  = SceneControllerObj.GetComponent <TouchControls>();
        GameController = SceneControllerObj.GetComponent <GameController>();
        cam            = GameController.cam;

        if (PlayerResetAtEdge)
        {
            //--if duel mode
            topConstraint = cam.ScreenToWorldPoint(new Vector3(0, Screen.height, 0)).y - 0.5f;
        }
        else
        {
            //--story mode
            topConstraint = 7f;
        }
    }
Пример #26
0
    public IEnumerator FinishGame()
    {
        gameFinished = true;

        TouchControls.LockControls();

        warrior.Agent.destination = new Vector3(-15, -1.5f, 170);

        //Small velocity boost to trigger the walking animation
        warrior.Agent.velocity = new Vector3(0f, 0f, 0.01f);

        yield return(new WaitForSeconds(2));

        StartCoroutine(Fade(fadeImage, 0.75f, 2));

        yield return(new WaitForSeconds(2));

        skullManager.RectTransform.anchoredPosition = new Vector2((Screen.width / 2), Screen.height / 2);

        finishFinished = true;
    }
Пример #27
0
 // Use this for initialization
 void Start()
 {
     flySR            = flyButton.GetComponent <Image> ();
     shootSR          = shootButton.GetComponent <Image> ();
     theTouchControls = FindObjectOfType <TouchControls> ();
 }
Пример #28
0
 private void Awake()
 {
     Singelton();
     touchControls = new TouchControls();
 }
Пример #29
0
 // Use this for initialization
 void Start()
 {
     flySR = flyButton.GetComponent<Image> ();
     shootSR = shootButton.GetComponent<Image> ();
     theTouchControls = FindObjectOfType<TouchControls> ();
 }
Пример #30
0
        private bool ProcessKioskControls(MouseEventArgs e)
        {
            activeTouch = TouchControls.None;
            timer.Enabled = false;
            if (Properties.Settings.Default.ShowTouchControls)
            {
                MakeTouchPoints();

                int tX = e.X + Properties.Settings.Default.ScreenHitTestOffsetX;
                int tY = e.Y + Properties.Settings.Default.ScreenHitTestOffsetY;

                if (tX > (renderWindow.Width - 207) && tX < (renderWindow.Width - 10))
                {
                    if (tY > renderWindow.Height - (234 + 120) && tY < (renderWindow.Height - 10))
                    {
                        moveVector = new PointF();
                        Point hit = PointToTouch(new Point(tX, tY));
                        for (int i = 0; i < touchPoints.Count; i++)
                        {
                            Vector2d test = new Vector2d(hit.X, hit.Y);
                            test = test - touchPoints[i];
                            if (test.Length < 11)
                            {
                                activeTouch = (TouchControls)i;
                                if (activeTouch == TouchControls.TrackBall)
                                {
                                    touchTrackBallCenter = new Point(tX, tY);
                                }
                                timer.Enabled = true;
                                return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
Пример #31
0
        private void renderWindow_MouseUp(object sender, MouseEventArgs e)
        {
            if (contrastMode)
            {
                contrastMode = false;
                return;
            }


            if (activeTouch != TouchControls.None)
            {
                if (activeTouch == TouchControls.Finder)
                {
                    if (kioskControl)
                    {
                        if (ObjectProperties.Active)
                        {
                            ObjectProperties.HideProperties();
                        }
                        else
                        {
                            ShowFinder();
                        }
                    }
                    else
                    {
                        Friction = !Friction;
                    }
                }
                if (activeTouch == TouchControls.Home)
                {
                    if (kioskControl)
                    {
                        if (TouchKiosk)
                        {
                            Properties.Settings.Default.SolarSystemScale = 1;
                            FadeInImageSet(GetDefaultImageset(ImageSetType.SolarSystem, BandPass.Visible));
                            CameraParameters camParams = new CameraParameters(45, 0, 360, 0, 0, 100);
                            GotoTarget(camParams, false, true);
                        }
                        else
                        {
                            CameraParameters camParams = new CameraParameters(0, 0, 360, 0, 0, 100);
                            GotoTarget(camParams, false, true);
                        }
                    }
                    else
                    {
                        TouchAllStop();
                    }
                }

                activeTouch = TouchControls.None;

                return;
            }


            if (uiController != null)
            {
                if (uiController.MouseUp(sender, new MouseEventArgs(e.Button, e.Clicks, e.X + Properties.Settings.Default.ScreenHitTestOffsetX, e.Y + Properties.Settings.Default.ScreenHitTestOffsetY, e.Delta)))
                {
                    return;
                }
            }

            if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Middle)
            {
                dragging = false;
                spinning = false;
                measuringDrag = false;
                measuring = false;
                angle = false;
                if (!moved && ShowKmlMarkers && Space)
                {

                    Point cursor = renderWindow.PointToClient(Cursor.Position);

                    Coordinates result = GetCoordinatesForScreenPoint(cursor.X, cursor.Y);

                    if (CurrentImageSet.DataSetType == ImageSetType.Sky)
                    {
                        if (!ProjectorServer)
                        {
                            if (constellationCheck != null)
                            {
                                if (ShowKmlMarkers && KmlMarkers != null)
                                {
                                    KmlMarkers.ItemClick(Coordinates.RADecTo3dDouble(result, 1.0).Vector311, (float)(ZoomFactor / 900.0));
                                }
                            }
                        }
                    }
                }
            }
            else if (e.Button == MouseButtons.Right)
            {
                if ((CurrentImageSet.DataSetType == ImageSetType.Sky || CurrentImageSet.DataSetType == ImageSetType.SolarSystem /*|| CurrentImageSet.DataSetType == ImageSetType.Planet || CurrentImageSet.DataSetType == ImageSetType.Earth*/ ) && !TourPlayer.Playing)
                {


                    if (figureEditor != null)
                    {
                        // TODO fix this for earth, plantes, panoramas
                        Coordinates result = GetCoordinatesForScreenPoint(e.X, e.Y);
                        string constellation = this.constellationCheck.FindConstellationForPoint(result.RA, result.Dec);
                        contextPanel.Constellation = Constellations.FullName(constellation);
                        IPlace closetPlace = ContextSearch.FindClosestMatch(constellation, result.RA, result.Dec, Earth3d.MainWindow.DegreesPerPixel * 80);
                        if (closetPlace == null)
                        {
                            closetPlace = new TourPlace(Language.GetLocalizedText(90, "No Object"), result.Dec, result.RA, Classification.Unidentified, constellation, ImageSetType.Sky, -1);
                        }
                        figureEditor.AddFigurePoint(closetPlace);
                    }
                    else
                    {
                        Point pntShow = new Point(e.X, e.Y);

                        if (SolarSystemMode)
                        {
                            ObjectProperties.ShowAt(renderWindow.PointToScreen(pntShow));

                        }
                        else
                        {
                            ShowPropertiesForPoint(pntShow);
                        }
                    }
                }
            }
        }
Пример #32
0
 private void Awake()
 {
     touchControls = GetComponent <TouchControls>();
     pilot         = GetComponent <Pilot>();
 }
Пример #33
0
        private bool ProcessTouchControls(MouseEventArgs e)
        {
            activeTouch = TouchControls.None;
            if (Properties.Settings.Default.ShowTouchControls)
            {
                MakeTouchPoints();

                var tX = e.X + Properties.Settings.Default.ScreenHitTestOffsetX;
                var tY = e.Y + Properties.Settings.Default.ScreenHitTestOffsetY;

                if (tX > (renderWindow.Width - 207) && tX < (renderWindow.Width - 10))
                {
                    if (tY > renderWindow.Height - (234 + 120 + 30) && tY < (renderWindow.Height - 10))
                    {

                        var hit = new Point(tX - (renderWindow.Width - 207), tY - (renderWindow.Height - (234 + 120)));

                        for (var i = touchPoints.Count - 1; i >= 0; i--)
                        {
                            var test = new Vector2d(hit.X, hit.Y);
                            test = test - touchPoints[i];
                            if (test.Length < 15)
                            {
                                activeTouch = (TouchControls)i;
                                if (activeTouch == TouchControls.TrackBall)
                                {
                                    touchTrackBallCenter = new Point(tX, tY);
                                    moveVector = new PointF();
                                    touchPoints[(int)TouchControls.PanTrack] = panTracker;
                                }
                                timer.Enabled = true;
                                return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
Пример #34
0
 // Use this for initialization
 void Start()
 {
     thePlayer = FindObjectOfType <CharacterMovementTile>();
     tcontrols = FindObjectOfType <TouchControls>();
 }