예제 #1
0
    void CallDisplay()
    {
        Node[]       all_nodes = FindObjectsOfType <Node>();
        StringCase[] all_case  = FindObjectsOfType <StringCase>();
        for (int i = 0; i < all_nodes.Length; ++i)
        {
            Node       node       = null;
            StringCase stringCase = null;
            if (i < all_nodes.Length)
            {
                node = all_nodes[i];
            }
            if (i < all_case.Length)
            {
                stringCase = all_case[i];
            }

            if (node != null)
            {
                IExpandableDisplay display = node.GetComponent <IExpandableDisplay>();
                if (display != null)
                {
                    if (isExpandDisplay)
                    {
                        display.isExpanded = true;
                        display.ExpandDisplay();
                    }
                    else
                    {
                        display.isExpanded = false;
                        display.NormalDisplay();
                    }
                }
            }
            if (stringCase != null)
            {
                if (isExpandDisplay)
                {
                    stringCase.isExpanded = true;
                    stringCase.ExpandDisplay();
                }
                else
                {
                    stringCase.isExpanded = false;
                    stringCase.NormalDisplay();
                }
            }
        }
    }
예제 #2
0
    public void Btn_ToogleEye()
    {
        isExpandDisplay = !isExpandDisplay;

        if (isExpandDisplay)
        {
            //이미지 교체
            toogleEyeImg.sprite = eye_opened_img;
            //확장형 디스플레이에서 확장디스플레이 호출
            GameObject[] all_objects = FindObjectsOfType <GameObject>();
            foreach (GameObject go in all_objects)
            {
                IExpandableDisplay display = go.GetComponent <IExpandableDisplay>();
                if (display != null)
                {
                    display.isExpanded = true;
                    display.ExpandDisplay();
                }
            }
        }
        else
        {
            //이미지 교체
            toogleEyeImg.sprite = eye_closed_img;
            //확장형 디스플레이에서 일반디스플레이 호출
            GameObject[] all_objects = FindObjectsOfType <GameObject>();
            foreach (GameObject go in all_objects)
            {
                IExpandableDisplay display = go.GetComponent <IExpandableDisplay>();
                if (display != null)
                {
                    display.isExpanded = false;
                    display.NormalDisplay();
                }
            }
        }
    }