Inheritance: MonoBehaviour
示例#1
0
	void Awake(){
		if(_instance == null){
			_instance = this;
			DontDestroyOnLoad(this);
		}else{
			if(this != _instance)
				Destroy(this.gameObject);
		}
	}
示例#2
0
    //收到登陆协议
    public void OnMsgLogin(MsgBase msgBase)
    {
        MsgLogin msg = (MsgLogin)msgBase;

        if (msg.result == 0)
        {
            Debug.Log("登陆成功");
            //设置id
            GameMain.id = msg.id;
            //打开房间列表界面
            PanelManager.Open <RoomListPanel>();
            //PanelManager.Open<ChoosePanel>();
            //关闭界面
            Close();
        }
        else
        {
            PanelManager.Open <TipPanel>("登陆失败");
        }
    }
示例#3
0
        public static void Fight(int pid, string map, int rlevel, PeopleFightParm reason, HsActionCallback winEvent, HsActionCallback lossEvent, HsActionCallback cancelEvent)
        {
            bool rt = PopDeckChoose.Show(map, UserProfile.InfoCard.GetDeckNames());

            if (!rt)
            {
                if (cancelEvent != null)
                {
                    cancelEvent();
                }
                return;
            }

            BattleForm bf = new BattleForm();

            bf.BattleWin  = winEvent;
            bf.BattleLose = lossEvent;
            bf.Init(0, pid, map, rlevel, reason);
            PanelManager.DealPanel(bf);
        }
示例#4
0
 public ImportManager()
 {
     Year = DateTime.Now.Year;
     _panelButtonManager = new PanelButtonManager {
         OnButtonAction = o => Import(), Icon = PackIconModernKind.OfficeExcel, Text = "Импорт"
     };
     _secondManager = new PanelButtonManager {
         OnButtonAction = o => Save(), Icon = PackIconModernKind.NavigateNext, Text = "Продолжить", ButtonVisibility = Visibility.Collapsed
     };
     Panel = new PanelManager
     {
         RightButtons = new List <PanelButtonManager>
         {
             _panelButtonManager, _secondManager, new PanelButtonManager {
                 OnButtonAction = o => OnExit(), Icon = PackIconModernKind.Cancel, Text = "Закрыть"
             }
         }
     };
     SelectFileCommand = new RelayCommand(SelectFile);
 }
示例#5
0
 public override void OnEnter()
 {
     if (isW == false)
     {
         UITool.FindChildGameObject("Jump").transform.Find("Key").GetComponent <Text>().text = "&%#";
     }
     if (isA == false)
     {
         UITool.FindChildGameObject("Left").transform.Find("Key").GetComponent <Text>().text = "!*#";
     }
     if (isD == false)
     {
         UITool.FindChildGameObject("Right").transform.Find("Key").GetComponent <Text>().text = "$^&";
     }
     UITool.GetOrAddComponentInChildren <Button>("Exit").onClick.AddListener(() =>
     {
         //点击事件
         PanelManager.Pop();
     });
     UITool.GetOrAddComponentInChildren <Button>("Jump").onClick.AddListener(() =>
     {
         //点击事件
         UITool.FindChildGameObject("Jump").transform.Find("Key").GetComponent <Text>().text = "Space";
         Debug.Log("Jump");
         isW = true;
     });
     UITool.GetOrAddComponentInChildren <Button>("Left").onClick.AddListener(() =>
     {
         //点击事件
         UITool.FindChildGameObject("Left").transform.Find("Key").GetComponent <Text>().text = "A";
         Debug.Log("Left");
         isA = true;
     });
     UITool.GetOrAddComponentInChildren <Button>("Right").onClick.AddListener(() =>
     {
         //点击事件
         UITool.FindChildGameObject("Right").transform.Find("Key").GetComponent <Text>().text = "D";
         Debug.Log("Right");
         isD = true;
     });
 }
示例#6
0
    void Awake()
    {
        _panels = panels;
        try
        {
            CanvasReferenceResolution = Canvas.gameObject.GetComponent <CanvasScaler>().referenceResolution;
        }
        catch
        {
            throw new System.ArgumentException("please assign canvas game object that has canvas scaler component attached with UI scale mode of type 'scale with screen size' to canvas slot. Without that we can't show tooltip panel properly :/. Just hit the stats button on game window , read your current resolution and type that in in canvas scaler component under 'reference resolution' on your canvas game object that you plan to assign to PanelManager canvas slot. ");
        }
        panelManager = GetComponent <PanelManager>();
        gamePaused   = false;

        canvasWidth           = Canvas.GetComponent <RectTransform>().sizeDelta.x;
        canvasHeight          = Canvas.GetComponent <RectTransform>().sizeDelta.y;
        isTransitionInProcess = false;
        SetNeededPanelPrivateFields();
        AdjustAlphaValues();
        DeactivateHideButtons();
    }
示例#7
0
    //当按下注册按钮
    public void OnRegClick()
    {
        //用户名密码为空
        if (idInput.text == "" || pwInput.text == "")
        {
            PanelManager.Open <TipPanel>("用户名和密码不能为空");
            return;
        }
        //两次密码不同
        if (repInput.text != pwInput.text)
        {
            PanelManager.Open <TipPanel>("两次输入的密码不同");
            return;
        }
        //发送
        MsgRegister msgReg = new MsgRegister();

        msgReg.id = idInput.text;
        msgReg.pw = pwInput.text;
        NetManager.Send(msgReg);
    }
示例#8
0
    //点赞回复
    public static bool SendGoodReply(string reply_id)
    {
        //写入数据库t_question表
        string sql =
            $"update t_reply set goodcount =goodcount+1 where id ={reply_id}";

        try
        {
            MySqlCommand cmd = new MySqlCommand(sql, mysql);
            cmd.ExecuteNonQuery();

            return(true);
        }
        catch (Exception e)
        {
            PanelManager.Open <TipPanel>
                ("[DBManager.SendCol()]用户点赞失败,异常为: " + e.Message);

            return(false);
        }
    }
示例#9
0
    //收藏问题
    public static bool SendCol(string question_id)
    {
        //写入数据库t_collect表
        string sql =
            $"INSERT INTO `qasysdb`.`t_collect` (`user_id`, `question_id`) VALUES ('{currentUser.id}', '{question_id}');";

        try
        {
            MySqlCommand cmd = new MySqlCommand(sql, mysql);
            cmd.ExecuteNonQuery();

            return(true);
        }
        catch (Exception e)
        {
            PanelManager.Open <TipPanel>
                ("[DBManager.SendCol()]用户收藏问题失败,异常为: " + e.Message);

            return(false);
        }
    }
示例#10
0
    //发送问题
    public static bool SendQue(string question, string content)
    {
        //写入数据库t_question表
        string sql =
            $"INSERT INTO `qasysdb`.`t_question` (`title`, `content`,`user_id`) VALUES('{question}', '{content}','{currentUser.id}');";

        try
        {
            MySqlCommand cmd = new MySqlCommand(sql, mysql);
            cmd.ExecuteNonQuery();

            return(true);
        }
        catch (Exception e)
        {
            PanelManager.Open <TipPanel>
                ("[DBManager.ReleaseQue()]用户发表问题失败,异常为: " + e.Message);

            return(false);
        }
    }
示例#11
0
    //收到登陆协议
    public void OnMsgLogin(MsgBase msgBase)
    {
        MsgLogin msg = (MsgLogin)msgBase;

        if (msg.result == 0)
        {
            Debug.Log("登陆成功");
            //设置id
            // GameMain.id = msg.id;
            //打开房间列表界面
            // PanelManager.Open<RoomListPanel>();
            PanelManager.Open <SelectPlayerPanel>();
            playersDataEnter(msg.playerSimpleInfos);
            //关闭界面
            Close();
        }
        else
        {
            PanelManager.Open <TipPanel>("登陆失败");
        }
    }
示例#12
0
 public EmployeesManager()
 {
     Panel = new PanelManager
     {
         LeftButtons = new List <PanelButtonManager>
         {
             new PanelButtonManager {
                 OnButtonAction = o => Add(), Icon = PackIconModernKind.Add, Text = "Add"
             },
             new PanelButtonManager {
                 OnButtonAction = o => Edit(), Icon = PackIconModernKind.Edit, Text = "Edit"
             },
             new PanelButtonManager {
                 OnButtonAction = o => Delete(), Icon = PackIconModernKind.Delete, Text = "Delete"
             }
         }
     };
     Degrees   = EnumExtender.GetAllDescriptions(typeof(AcademicDegree));
     Ranks     = EnumExtender.GetAllDescriptions(typeof(AcademicRank));
     Positions = EnumExtender.GetAllDescriptions(typeof(WorkingPosition));
 }
示例#13
0
    public void CheckRemainEnemy()
    {
        remainSpawnCount--;

        if (remainSpawnCount <= 0)
        {
            waveCount = ++InGameSceneManager.instance.waveCount;
            PanelManager.GetPanel <InGameInfoPanel>().SetWaveCount();

            for (int i = 0; i < waveCount; i++)
            {
                List <Transform> tiles = InGameSceneManager.instance.MapGenerator.tileList;

                int randomTileIndex = Random.Range(0, tiles.Count);
                int randomItemIndex = Random.Range(0, itemPrefabs.Length);
                Instantiate(itemPrefabs[randomItemIndex], tiles[randomTileIndex].position, Quaternion.identity);
            }

            StartCoroutine(SpawnWithDelay());
        }
    }
示例#14
0
    void Start()
    {
        var PanelManagerContainer = GameObject.Find("PanelManager");

        _PanelManager = PanelManagerContainer.GetComponent <PanelManager>();

        if (_PanelManager == null)
        {
            Debug.Log("Could not find PanelManager");
        }
        var thisButton = GetComponent <Button>();

        if (thisButton != null)
        {
            thisButton.onClick.AddListener(OnClick);
        }
        else
        {
            Debug.Log("Woops, LoadScene needs to be on a Button!");
        }
    }
示例#15
0
 public GroupsManager()
 {
     Panel = new PanelManager
     {
         LeftButtons = new List <PanelButtonManager>
         {
             new PanelButtonManager {
                 OnButtonAction = o => Add(), Icon = PackIconModernKind.Add, Text = "Add"
             },
             new PanelButtonManager {
                 OnButtonAction = o => Edit(), Icon = PackIconModernKind.Edit, Text = "Edit"
             }
         },
         RightButtons = new List <PanelButtonManager>
         {
             new PanelButtonManager {
                 OnButtonAction = o => Delete(), Icon = PackIconModernKind.Delete, Text = "Delete"
             },
         }
     };
 }
    // Update is called once per frame
    void Update()
    {
        RaycastHit hit;
        Ray        ray  = new Ray(transform.position, cam.transform.forward);
        bool       bHit = Physics.Raycast(ray, out hit, 10f, mask);

        if (bHit)
        {
            PanelManager pm = hit.collider.GetComponent <PanelManager>();

            if (pm)
            {
                label.text = "Now examining Sector " + pm.hexagon;
                //Debug.Log(pm.hexagon);
            }
        }
        else
        {
            label.text = "Nothing to examine";
        }
    }
示例#17
0
        public Program()
        {
            try {
                Runtime.UpdateFrequency = UpdateFrequency.Update10;

                lights         = new List <IMyInteriorLight>();
                vents          = new List <IMyAirVent>();
                tanks          = new List <IMyGasTank>();
                h2o2generators = new List <IMyGasGenerator>();
                panels         = new List <IMyTextPanel>();

                text = new StringBuilder();

                GridTerminalSystem.GetBlocksOfType(lights, light => light.IsSameConstructAs(Me) && light.CustomName.Contains(LIGHT_TAG));
                GridTerminalSystem.GetBlocksOfType(vents, vent => vent.IsSameConstructAs(Me) && vent.CustomName.Contains(O2_SYSTEM_TAG));
                GridTerminalSystem.GetBlocksOfType(tanks, tank => tank.IsSameConstructAs(Me) && tank.CustomName.Contains(O2_SYSTEM_TAG));
                GridTerminalSystem.GetBlocksOfType(h2o2generators, generator => generator.IsSameConstructAs(Me) && generator.CustomName.Contains(O2_SYSTEM_TAG));
                GridTerminalSystem.GetBlocksOfType(panels, panel => panel.IsSameConstructAs(Me) && panel.CustomName.Contains(DISPLAY_TAG));

                panelManager = new PanelManager(panels);


                SetOxygenProduction(false);
                SetLightColor(redColor);
                panelManager.SetStatus(true);
                panelManager.SetBackColor(new Color(10, 10, 30));
                panelManager.SetFontColor(new Color(255, 125, 0));
                panelManager.SetFontSize(1.5f);
                panelManager.SetTitle("[O2] Life Support Systems", false);
                panelManager.SetText("Initializing...", false);
            }
            catch (Exception e) {
                // Dump the exception content to the
                Echo("An error occurred during script execution.");
                Echo($"Exception: {e}\n---");

                // Rethrow the exception to make the programmable block halt execution properly
                throw;
            }
        }
示例#18
0
    IEnumerator PreLoadPrefabFromRes(string name)
    {
        ResourceRequest request = Resources.LoadAsync("Prefabs/" + name);

        yield return(request);

        GameObject instance = Instantiate(request.asset) as GameObject;

        Transform instanceTran = instance.transform;

        instanceTran.parent        = GameUiManager.UIRootTran;
        instanceTran.localPosition = Vector3.zero;
        instanceTran.localScale    = Vector3.one;

        PanelManager.PanelModuleData panelData = PanelManager.GetInstance().getComponent(name);


        instance.name = name;
        string component = panelData.panelName;

        if (string.IsNullOrEmpty(component) == false)
        {
            UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(instance, "Assets/client_code/interface/manager/ResourceManager.cs (341,4)", component);
        }

        UIPanelBase panel = instance.gameObject.GetComponent <UIPanelBase>();

        if (instance != null && instance.gameObject != null)
        {
            instance.gameObject.SetActive(false);
        }

        if (panel != null)
        {
            //GameUiManager.getInst().PreLoadDontUseThisShowPanel(panel);
        }

        GameUiManager.getInst().addLoadedWindow(name, panel, false);
        GameUiManager.getInst().removeLoadingWindow(name);
    }
示例#19
0
    private void unselected_all(string except_name)
    {
        PanelManager.hide_all_panels();

        if (except_name != "fish")
        {
            ((fish_script)fish.GetComponent(typeof(fish_script))).change_to_selected_state(false);
        }

        if (except_name != "boat")
        {
            ((boat_script)boat.GetComponent(typeof(boat_script))).change_to_selected_state(false);
        }

        if (except_name != "bird")
        {
            ((bird_script)bird.GetComponent(typeof(bird_script))).change_to_selected_state(false);
        }

        if (except_name != "tower")
        {
            ((lighthouse_script)tower.GetComponent(typeof(lighthouse_script))).change_to_selected_state(false);
        }

        if (except_name != "bottle 1")
        {
            if (bottle1 != null)
            {
                ((bottle_script)bottle1.GetComponent(typeof(bottle_script))).change_to_selected_state(false);
            }
        }

        if (except_name != "bottle 2")
        {
            if (bottle2 != null)
            {
                ((bottle_script)bottle2.GetComponent(typeof(bottle_script))).change_to_selected_state(false);
            }
        }
    }
 private void Start()
 {
     Poutch = GameObject.FindGameObjectWithTag("Beast");
     while (Poutch.transform.parent != null)
     {
         Poutch = Poutch.transform.parent.gameObject;
     }
     pc    = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     timer = -1f;
     Pm    = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PanelManager>();
     Tm    = Pm.GetComponent <TrapManager>();
     Sm    = Poutch.GetComponent <SummonMini>();
     StartTimer(me.me.entryLine);
     ResetSpeak();
     attackTimer = me.me.cooldown;
     ResetCooldown();
     if (me.me.classe == Character.Classe.Clone)
     {
         cooldownPanel.gameObject.SetActive(false);
     }
     speTimer = -1.5f;
 }
示例#21
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.E))
     {
         canvasCameraCounter++;
         if (canvasCameraCounter % 2 == 1)
         {
             PanelManager panelManager = new PanelManager();
             panel.SetActive(true);
             PanelManager.commitedPoints = true;
             PanelManager.baseStats      = true;
             ClickToMove.ifIsBusy        = true;
             panelManager.PopulatePanel();
         }
         else
         {
             panel.SetActive(false);
             PanelManager.commitedPoints = false;
             ClickToMove.ifIsBusy        = false;
         }
     }
 }
示例#22
0
 public DisciplinesManager()
 {
     Panel = new PanelManager
     {
         LeftButtons = new List <PanelButtonManager>
         {
             new PanelButtonManager {
                 OnButtonAction = o => Add(), Icon = PackIconModernKind.Add, Text = "Add"
             },
             new PanelButtonManager {
                 OnButtonAction = o => Edit(), Icon = PackIconModernKind.Edit, Text = "Edit"
             }
         },
         RightButtons = new List <PanelButtonManager>
         {
             new PanelButtonManager {
                 OnButtonAction = o => Delete(), Icon = PackIconModernKind.Delete, Text = "Delete"
             },
         }
     };
     MouseDoubleClickCommand = new RelayCommand(Edit);
 }
示例#23
0
    /// <summary>
    /// 客户端处理发牌协议
    /// </summary>
    /// <param name="msgBase"></param>
    public void OnMsgFaPai(MsgBase msgBase)
    {
        Debug.Log("can receive msgFaPai");
        MsgFaPai msg = (MsgFaPai)msgBase;

        nowTurnid = msg.id;
        if (msg.paiId == -1)
        {
            Debug.Log("没牌了,游戏结束");
            PanelManager.Open <GameoverPanel>(-1, client_id, -1);
            PanelManager.Close("GamePanel");
            return;
        }

        gamePanel.TurnText = msg.turnNum; //设置现在是第几轮了
        gamePanel.TurnLight(msg.id);      //切换灯光
        if (msg.id == client_id)          //如果是玩家,就显示出牌/发动技能/胡的按钮
        {
            gamePanel.ChuPaiButton = true;
            if (msg.isHu)
            {
                gamePanel.HuButton = true;
            }
            if (msg.canSkill)
            {
                gamePanel.SkillButton = true;
            }
        }

        CreatePai(msg.paiId, msg.id);
        players[msg.id].SynHandPai(); //调整牌的顺序
        players[msg.id].PlacePai();   //调整牌的位置
        gamePanel.HandPaiCount    = new int[] { (int)gamePanel.numToDir[msg.id], players[msg.id].handPai.Count };
        gamePanel.PlayerStateText = "玩家" + (msg.id + 1) + "出牌";

        isChuPai = true;
        //开始计时,玩家出牌
        StartTimeCount();
    }
示例#24
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        ui = FindObjectOfType <PanelManager>();

        allyPrefab  = (GameObject)Resources.Load("Prefabs/AllyCrit", typeof(GameObject));
        enemyPrefab = (GameObject)Resources.Load("Prefabs/EnemyCrit", typeof(GameObject));

        spawnsCrit = GetComponentsInChildren <Transform>();

        LimitCritters();
        CreateCritters();

        character = new Competitor(allyCritters);
        enemy     = new Competitor(enemyCritters);

        battleground = new Battleground(character, enemy, (ui as IObserver));
    }
示例#25
0
        public ActionResult CreatePanel(List <PanelCheckboxModel> employeeList)
        {
            //Save into DB
            Examination examObj          = Session["ExamObj"] as Examination;
            var         selectedEmployee = employeeList.Where(e => e.Checked);

            if (examObj != null)
            {
                var technicalpanelManager = new PanelManager();

                var employees = technicalpanelManager.GetEmployeesBylocation(examObj.LocationId);

                var technicalPanel = new Technicalpanel();

                foreach (var emp in selectedEmployee)
                {
                    var empObj = employees.FirstOrDefault(x => x.EmployeeId == emp.EmployeeId);

                    if (empObj != null)
                    {
                        technicalPanel.Employees.Add(empObj);
                    }
                }

                var panelDTO = technicalpanelManager.CreateAndGetTechnicalPanel(technicalPanel);

                examObj.TechnicalPanleId = panelDTO.TechnicalpanelId;

                var manager = new ExaminationManager();
                manager.Update(examObj);

                return(View("Index"));
            }

            else
            {
                return(View("Error"));
            }
        }
示例#26
0
        public CalculateSettingsManager()
        {
            Panel = new PanelManager
            {
                LeftButtons = new List <PanelButtonManager>
                {
                    new PanelButtonManager {
                        OnButtonAction = o => Add(), Icon = PackIconModernKind.Add, Text = "Add"
                    },
                },

                RightButtons = new List <PanelButtonManager>
                {
                    new PanelButtonManager {
                        OnButtonAction = o => Save(), Icon = PackIconModernKind.Save, Text = "Save"
                    },
                    new PanelButtonManager {
                        OnButtonAction = o => Delete(), Icon = PackIconModernKind.Delete, Text = "DeleteRow"
                    }
                }
            };
        }
示例#27
0
    private IEnumerator PromotionProcess()
    {
        yield return(new WaitUntil(() => !IsMoving));

        promotionPanel.SetActive(true);
        PanelManager panelManager = promotionPanel.GetComponent <PanelManager>();

        yield return(new WaitUntil(() => panelManager.promotionPiece != PieceType.None));

        promotionPanel.SetActive(false);
        GameObject obj   = Instantiate(pieceType[(int)panelManager.promotionPiece], boardManager.transform);
        Piece      piece = obj.GetComponent <Piece>();

        piece.team             = this.team;
        obj.transform.position = this.transform.position;

        ((IPromotionMove)boardManager.LastMove).PromotionPiece = piece;
        this.gameObject.SetActive(false);

        UnFocus();
        SendMessageUpwards("EndTurn", true);
    }
示例#28
0
    //取得用户数据
    public static void GetUserData(string email)
    {
        CheckAndReconnect();

        //防sql注入
        if (!IsSafeString(email))
        {
            PanelManager.Open <TipPanel>("您输入的邮箱不合法,请重新输入!");
        }

        string sql = $"select * from t_user where email ='{email}';";

        MySqlCommand    cmd;
        MySqlDataReader dataReader;

        try
        {
            //查询
            cmd        = new MySqlCommand(sql, mysql);
            dataReader = cmd.ExecuteReader();

            if (!dataReader.HasRows)
            {
                dataReader.Close();
            }
            //读取
            dataReader.Read();
            currentUser          = new UserData();
            currentUser.id       = dataReader.GetString("id");
            currentUser.email    = email;
            currentUser.nickName = dataReader.GetString("nickname");
            dataReader.Close();
        }
        catch (Exception e)
        {
            Debug.Log("[DBManager.GetUserData()]获取用户数据失败,异常为" + e.Message);
        }
    }
示例#29
0
    //根据回复id查找回复的数据
    public static ReplyData GetReplyByID(string reply_id)
    {
        CheckAndReconnect();

        string sql = $"select * from t_reply where id='{reply_id}';";

        try
        {
            //查询
            MySqlCommand    cmd        = new MySqlCommand(sql, mysql);
            MySqlDataReader dataReader = cmd.ExecuteReader();

            if (!dataReader.HasRows)
            {
                dataReader.Close();
            }

            dataReader.Read();
            ReplyData rd = new ReplyData();

            rd.id          = dataReader.GetString("id");
            rd.content     = dataReader.GetString("content");
            rd.question_id = dataReader.GetString("question_id");
            rd.user_id     = dataReader.GetString("user_id");
            rd.goodcount   = dataReader.GetString("goodcount");

            dataReader.Close();

            return(rd);
        }
        catch (Exception e)
        {
            PanelManager.Open <TipPanel>
                ("[DBManager.GetReplyByID()]获取当前回复的信息失败,异常为" + e.Message);

            return(null);
        }
    }
    bool AB(Event e)
    {
        bool EventDown = (e.modifiers & EventModifiers.Control) != 0;

        switch (e.keyCode)
        {
        case KeyCode.E:
            if (EventDown)
            {
                e.Use();
                if (PanelManager.IsHide("KnapsackPanel"))
                {
                    PanelManager.Hide("KnapsackPanel");
                }
                else
                {
                    PanelManager.UnHide("KnapsackPanel");
                }
            }
            return(true);

        case KeyCode.W:
            if (EventDown)
            {
                e.Use();
                if (PanelManager.IsHide("ShopPanel"))
                {
                    PanelManager.Hide("ShopPanel");
                }
                else
                {
                    PanelManager.UnHide("ShopPanel");
                }
            }
            return(true);
        }
        return(false);
    }
示例#31
0
 protected void SystemButton_MouseUp(object sender, MouseEventArgs e)
 {
     if (isEscButton && (this.Width > e.Location.X) && (e.Location.X > 0) && (this.Height > e.Location.Y) && (e.Location.Y > 0))
     {
         Application.Exit();
     }
     else if (isEscButton)
     {
         active = false;
     }
     else if (!isEscButton)
     {
         if (PanelManager.GetPanelSet() == PanelManager.PanelSet.Controller)
         {
             PanelManager.SetPanelSet(PanelManager.PanelSet.Settings);
         }
         else if (PanelManager.GetPanelSet() == PanelManager.PanelSet.Settings)
         {
             PanelManager.SetPanelSet(PanelManager.PanelSet.Controller);
         }
     }
     this.Refresh();
 }
    private void Awake()
    {
        if (s_instance == null)
        {
            s_instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Debug.LogError("There can be only one PanelManager");
        }

        int numPanels = m_managedPanels.Count;
        for (int i=0; i<numPanels; i++)
        {
            GameObject panel = m_managedPanels[i];
            if(panel == m_initialPanel)
            {
                AddPanel(panel);
            }
            else
            {
                RemovePanel(panel);
            }
        }

        GameManager.Instance.Initialize ();
    }