// Update is called once per frame
    void Update()
    {
        x = Input.mousePosition.x;
        y = Input.mousePosition.y;

        cs = Camera.main.GetComponent <CardSortTestHandler>();
        e  = cs.backEndItem.currentEvent.type;
    }
    public void Continue()
    {
        CardSortTestHandler cs = Camera.main.GetComponent <CardSortTestHandler>();

        cs.backEndItem.eventNumber++;

        Destroy(GameObject.Find("startbutton"));
    }
    //TODO: Bug in dropping card after a card is already there, locks previous card
    // Update is called once per frame
    void Update()
    {
        CardSortTestHandler cs = Camera.main.GetComponent <CardSortTestHandler>();

        EventSystem.typeOfEvent e = cs.backEndItem.currentEvent.type;

        isMouseDown = Input.GetMouseButton(0);

        if (!isMouseDown && isColliding && collidingGO && e == EventSystem.typeOfEvent.Mouse)
        {
            //collidingGO.transform.position = new Vector2(transform.position.x, transform.position.y);
            print(gameObject.name);
            if (gameObject.name.Contains("true"))
            {
                CardSortOutputHandler.correct = true;

                if (!cs.backEndItem.currentEvent.jumpLabel.Equals(""))
                {
                    for (int i = cs.backEndItem.eventNumber + 1; i < cs.backEndItem.events.Length; i++)
                    {
                        if (cs.backEndItem.currentEvent.jumpLabel.Equals(cs.backEndItem.events[i].jumpLabel))
                        {
                            cs.backEndItem.eventNumber = i;
                            break;
                        }
                    }
                }
                else
                {
                    cs.backEndItem.eventNumber++;
                }
            }
            else
            {
                CardSortOutputHandler.correct = false;
                cs.backEndItem.eventNumber++;
            }
        }
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     cs = Camera.main.GetComponent <CardSortTestHandler>();
 }