private void Start()
    {
        Cursor.visible = false;
        eventTrigger   = GetComponent <EventTrigger>();
        if (eventTrigger != null)
        {
            EventTrigger.Entry enterUIEntry = new EventTrigger.Entry();
            // Pointer Enter
            enterUIEntry.eventID = EventTriggerType.PointerEnter;
            enterUIEntry.callback.AddListener((eventData) => { EnterUI(); });
            eventTrigger.triggers.Add(enterUIEntry);

            //Pointer Exit
            EventTrigger.Entry exitUIEntry = new EventTrigger.Entry();
            exitUIEntry.eventID = EventTriggerType.PointerExit;
            exitUIEntry.callback.AddListener((eventData) => { ExitUI(); });
            eventTrigger.triggers.Add(exitUIEntry);
        }


        //Objects
        masterListDrop = MasterList.GetComponent <Dropdown>();
        design         = Selection[0].GetComponent <Design>();

        //Menu Active / noneActive
        ArrowUp.SetActive(true);
        ArrowDown.SetActive(false);

        MasterList.SetActive(true);
        SubList.SetActive(false);
    }
    public void ExitUI()
    {
        BlockedByUI    = false;
        Cursor.visible = false;

        //set Active non-active
        ArrowUp.SetActive(true);
        ArrowDown.SetActive(false);

        MasterList.SetActive(true);
        SubList.SetActive(false);
    }
    private void Update()
    {
        MasterFunction();

        //MemuPops on left if move mouse left
        Vector3 mouse = Input.mousePosition;

        if (mouse.x <= 100f)
        {
            ArrowUp.SetActive(false);
            ArrowDown.SetActive(true);

            MasterList.SetActive(true);
            SubList.SetActive(true);
        }
    }
    public void EnterUI()
    {
        BlockedByUI    = true;
        Cursor.visible = true;

        GameObject GridObj = GameObject.Find("Grid");
        GameObject destroy = GameObject.Find("MousePointer");

        if (GridObj != null)
        {
            Grid grid = GridObj.GetComponent <Grid>();
            grid.mousePointer = null;
            Destroy(destroy);
        }

        //Active non-Active
        ArrowUp.SetActive(false);
        ArrowDown.SetActive(true);

        MasterList.SetActive(true);
        SubList.SetActive(true);
    }
Example #5
0
 void Update()
 {
     if (!wait)
     {
         if (up)
         {
             ArrowUp.SetActive(true);
             ArrowDown.SetActive(false);
             transform.position += Vector3.up * Time.deltaTime * speed;
             if (transform.position.y >= maxY)
             {
                 transform.position = new Vector3(transform.position.x, maxY, transform.position.z);
                 wait = true;
                 up   = false;
             }
         }
         else
         {
             ArrowUp.SetActive(false);
             ArrowDown.SetActive(true);
             transform.position += Vector3.down * Time.deltaTime * speed;
             if (transform.position.y <= minY)
             {
                 transform.position = new Vector3(transform.position.x, minY, transform.position.z);
                 wait = true;
                 up   = true;
             }
         }
     }
     else
     {
         timer += Time.deltaTime;
         if (timer >= waitTime)
         {
             timer = 0.0f;
             wait  = false;
         }
     }
 }