Beispiel #1
0
 private void construct(UI.Screen screen)
 {
     LastScreen = screen.AsIntangible();
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #2
0
        public int addIndication(UI.Screen screen, string message)
        {
            if (activeIndicators.Count > 0)
            {
                clearIndication(indicationID);
            }

            if (screen == UI.Screen.left)
            {
                GameObject indicator1 = Instantiate(indicatorLeft) as GameObject;
                indicator1.GetComponent <Widget> ().layoutScreen          = UI.Screen.right;
                indicator1.GetComponent <Widget> ().layoutAlignHorizontal = AlignmentH.center;
                indicator1.GetComponent <Widget> ().layoutAlignVertical   = AlignmentV.center;
                indicator1.SetActive(true);
                Text t = indicator1.GetComponentInChildren <Text> ();
                t.text = message;
                indicator1.transform.SetParent(transform, false);
                activeIndicators.Add(indicator1);

                GameObject indicator2 = Instantiate(indicatorLeft) as GameObject;
                indicator2.GetComponent <Widget> ().layoutScreen          = UI.Screen.center;
                indicator2.GetComponent <Widget> ().layoutAlignHorizontal = AlignmentH.center;
                indicator2.GetComponent <Widget> ().layoutAlignVertical   = AlignmentV.center;
                indicator2.SetActive(true);
                t      = indicator2.GetComponentInChildren <Text> ();
                t.text = message;
                indicator2.transform.SetParent(transform, false);
                activeIndicators.Add(indicator2);
            }
            else if (screen == UI.Screen.center)
            {
                GameObject indicator1 = Instantiate(indicatorLeft) as GameObject;
                indicator1.GetComponent <Widget> ().layoutScreen          = UI.Screen.right;
                indicator1.GetComponent <Widget> ().layoutAlignHorizontal = AlignmentH.center;
                indicator1.GetComponent <Widget> ().layoutAlignVertical   = AlignmentV.center;
                indicator1.SetActive(true);
                Text t = indicator1.GetComponentInChildren <Text> ();
                t.text = message;
                indicator1.transform.SetParent(transform, false);
                activeIndicators.Add(indicator1);

                GameObject indicator2 = Instantiate(indicatorRight) as GameObject;
                indicator2.GetComponent <Widget> ().layoutScreen          = UI.Screen.left;
                indicator2.GetComponent <Widget> ().layoutAlignHorizontal = AlignmentH.center;
                indicator2.GetComponent <Widget> ().layoutAlignVertical   = AlignmentV.center;
                indicator2.SetActive(true);
                t      = indicator2.GetComponentInChildren <Text> ();
                t.text = message;
                indicator2.transform.SetParent(transform, false);
                activeIndicators.Add(indicator2);
            }
            else if (screen == UI.Screen.right)
            {
                GameObject indicator1 = Instantiate(indicatorRight) as GameObject;
                indicator1.GetComponent <Widget> ().layoutScreen          = UI.Screen.left;
                indicator1.GetComponent <Widget> ().layoutAlignHorizontal = AlignmentH.center;
                indicator1.GetComponent <Widget> ().layoutAlignVertical   = AlignmentV.center;
                indicator1.SetActive(true);
                Text t = indicator1.GetComponentInChildren <Text> ();
                t.text = message;
                indicator1.transform.SetParent(transform, false);
                activeIndicators.Add(indicator1);

                GameObject indicator2 = Instantiate(indicatorRight) as GameObject;
                indicator2.GetComponent <Widget> ().layoutScreen          = UI.Screen.center;
                indicator2.GetComponent <Widget> ().layoutAlignHorizontal = AlignmentH.center;
                indicator2.GetComponent <Widget> ().layoutAlignVertical   = AlignmentV.center;
                indicator2.SetActive(true);
                t      = indicator2.GetComponentInChildren <Text> ();
                t.text = message;
                indicator2.transform.SetParent(transform, false);
                activeIndicators.Add(indicator2);
            }
            return(++indicationID);
        }