示例#1
0
    // Update is called once per frame
    void Update()
    {
        Vector2     pos           = fmvman.ScreenToVideo(Input.mousePosition);//Camera.main.ScreenToViewportPoint(Input.mousePosition);
        PuzzlePoint pp            = GetPuzzlePoint(pos);
        int         puzzle_videos = fmvman.CountPlayingVideos("puzzle");

        //if (puzzle_videos > 0) Debug.Log("puzzle_videos == "+puzzle_videos.ToString());
        if (puzzle_videos > 0)
        {
            pp = null;
        }
        if (pp != null)
        {
            SetCursor(fmvman.blueeye);
        }
        else
        {
            SetCursor(fmvman.handwag);
        }
        if (Input.GetMouseButtonDown(0))
        {
            //Debug.Log("clicked at "+pos.ToString("0.00"));
            if (pp != null)
            {
                OnClick(pos, pp);
            }
        }
    }
示例#2
0
    protected void Update()
    {
        if (fmvman.playlist.Count > 0 || fmvman.CountPlayingVideos("") > 0)
        {
            SetCursor(fmvman.handwag);
            return;
        }
        Vector2 pos = fmvman.ScreenToVideo(Input.mousePosition);// Camera.main.ScreenToViewportPoint(Input.mousePosition);
        var     nc  = GetNodeConnection(pos);

        if (nc == null)
        {
            SetCursor(fmvman.handwag);
        }
        else if (nc.type == ClickboxType.DRAMAMASK)
        {
            SetCursor(fmvman.dramamask);
        }
        else if (nc.type == ClickboxType.CHATTERINGTEETH)
        {
            SetCursor(fmvman.chatteringteeth);
        }
        else if (nc.type == ClickboxType.PUZZLE)
        {
            SetCursor(fmvman.throbbingbrain);
        }
        else
        {
            SetCursor(fmvman.handbeckon);
        }

        if (Input.GetAxis("Horizontal") < -0.2f)
        {
            nc = GetNodeConnection(fakeClickLeft);
            if (nc == null)
            {
                nc = GetNodeConnection(fakeClickTurnaround);
            }
            if (nc == null)
            {
                nc = GetNodeConnection(fakeClickRight);
            }
            OnClick(fakeClickLeft, nc);
        }
        else if (Input.GetAxis("Horizontal") > 0.2f)
        {
            nc = GetNodeConnection(fakeClickRight);
            if (nc == null)
            {
                nc = GetNodeConnection(fakeClickTurnaround);
            }
            if (nc == null)
            {
                nc = GetNodeConnection(fakeClickLeft);
            }
            OnClick(fakeClickRight, nc);
        }
        else if (Input.GetAxis("Vertical") < -0.2f)
        {
            nc = GetNodeConnection(fakeClickTurnaround);
            if (nc == null)
            {
                nc = GetNodeConnection(fakeClickLeft);
            }
            if (nc == null)
            {
                nc = GetNodeConnection(fakeClickRight);
            }
            OnClick(fakeClickTurnaround, nc);
        }
        else if (Input.GetAxis("Vertical") > 0.2f)
        {
            nc = GetClosestNodeConnection(fakeClickForwards);
            OnClick(fakeClickForwards, nc);
        }

        else if (Input.GetMouseButtonDown(0))
        {
            OnClick(pos, nc);
        }
        if (Input.GetMouseButtonDown(1))
        {
            Debug.Log("right clicky! " + pos.ToString("0.00") + " from " + currPos.node.ToString() + " " + currPos.facing);
        }
    }