예제 #1
0
파일: Game.cs 프로젝트: zcaalock/valkyrie
    //  This is here because the editor doesn't get an update, so we are passing through mouse clicks to the editor
    void Update()
    {
        updateList.RemoveAll(delegate(IUpdateListener o) { return(o == null); });
        for (int i = 0; i < updateList.Count; i++)
        {
            if (!updateList[i].Update())
            {
                updateList[i] = null;
            }
        }
        updateList.RemoveAll(delegate(IUpdateListener o) { return(o == null); });

        if (Input.GetMouseButtonDown(0))
        {
            foreach (IUpdateListener iul in updateList)
            {
                iul.Click();
            }
        }
        // 0 is the left mouse button
        if (qed != null && Input.GetMouseButtonDown(0))
        {
            qed.MouseDown();
        }

        // 0 is the left mouse button
        if (qed != null && Input.GetMouseButtonDown(1))
        {
            qed.RightClick();
        }

        if (quest != null)
        {
            quest.Update();
        }

        if (Input.GetKey("right alt") || Input.GetKey("left alt"))
        {
            if (Input.GetKeyDown("d") && logWindow != null)
            {
                logWindow.Update(true);
            }
        }

        if (gameSelect != null)
        {
            gameSelect.Update();
        }
    }