示例#1
0
    /// <summary>
    /// this handles the mouse down events on the tinkergraphic
    /// playes the animation for that graphic so it is attached
    /// also handles the animating of the text paired to that graphic
    /// </summary>
    public void MyOnMouseDown()
    {
        System.DateTime time = System.DateTime.Now;

        //sending data directly to firebase using "72 hours rule"! (removed local data storage)
        //DataCollection.AddInTouchData (("Graphic_"+dataTinkerGraphic.label),  time.ToString());

        FirebaseHelper.LogInAppTouch(("Graphic_" + dataTinkerGraphic.label), time.ToString());
        int length = dataTinkerGraphic.anim.Length;

        //for (int i = 0; i < length; i++) {
        //Debug.Log ("anim_no "+ i);
        //LoadAndPlayAnimation (i);
        //StartCoroutine (animdelay());
        //}
        PlayCompleteAnim();
        sceneManager.OnMouseDown(this);
    }
示例#2
0
    /// <summary>
    /// Checks the mouse events and calls the respective scenemanager event.
    /// </summary>
    void Update()
    {
        // Check for mouse input
        if (Input.GetMouseButtonDown(0))
        {
            // Check what was under mouse down (if anything)
            List <GameObject> gos = PickGameObjects(Input.mousePosition);

            // Pass the game object along to the current scene manager (if any) to let it respond
            if (sceneManager != null && gos.Count != 0)
            {
                sceneManager.OnMouseDown(gos[0]);
            }
        }

        else if (Input.GetMouseButton(0))
        {
            // Check what was under mouse down (if anything)
            List <GameObject> gos = PickGameObjects(Input.mousePosition);
            // Pass the game object along to the current scene manager (if any) to let it respond
            if (sceneManager != null && gos.Count != 0)
            {
                sceneManager.OnMouseCurrentlyDown(gos[0]);
            }
            if (gos.Count == 0)
            {
                // Anytime a mouse currently down event misses any gameobject, update applicable lists in scene manager
                sceneManager.ResetInputStates(MouseEvents.MouseCurrentlyDown);
            }
        }

        else if (Input.GetMouseButtonUp(0))
        {
            // Check what was under mouse down (if anything)
            List <GameObject> gos = PickGameObjects(Input.mousePosition);
            // Pass the game object along to the current scene manager (if any) to let it respond
            if (sceneManager != null && gos.Count != 0)
            {
                sceneManager.OnMouseUp(gos[0]);
            }
            // Anytime there is a mouse up event, update applicable lists in scene manager
            sceneManager.ResetInputStates(MouseEvents.MouseUp);
        }

        // quit game on exit
        else if (Input.GetKeyDown(KeyCode.Escape))
        {
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }
    }