Exemple #1
0
 public void OnToggleClick(GameToggle toggle, bool value, int index)
 {
     if (value && currIndex != index)
     {
     }
     else
     {
     }
 }
        //Closes or opens the game.
        private void ToggleGame(GameToggle toggle)
        {
            if (toggle == GameToggle.Start)
            {
                Process.Start(Global.ReadSettings().Item2);
            }

            else if (toggle == GameToggle.Stop)
            {
                Process[] game = Process.GetProcessesByName("TheMessenger");

                if (game.Length > 0)
                {
                    game[0].CloseMainWindow();
                }
            }
        }
Exemple #3
0
        private void InitPointList()
        {
            if (pointList != null && pointList.Count > 0)
            {
                for (int i = 0; i < pointList.Count; i++)
                {
                    pointList[i].gameObject.SetActive(false);
                }
            }

            if (PointObj != null && PointListObj != null)
            {
                childCount = content.childCount;
                GameObject point = null;
                for (int i = 0; i < childCount; i++)
                {
                    if (i >= pointList.Count)
                    {
                        point = GameObject.Instantiate(PointObj) as GameObject;
                    }
                    else
                    {
                        point = pointList[i].gameObject;
                    }
                    if (point != null)
                    {
                        point.name = i.ToString();
                        point.transform.SetParent(PointListObj.transform);
                        point.transform.localScale    = Vector3.one;
                        point.transform.localPosition = Vector3.zero;
                        point.SetActive(true);
                        GameToggle toggle = point.GetComponent <GameToggle>();
                        if (toggle != null)
                        {
                            pointList.Add(toggle);
                            //int index = i;
                            //toggle.onValueChanged.AddListener((bool value) => OnToggleClick(toggle, value, index));
                        }
                    }
                }
                SetPointLight(0);
            }
        }