示例#1
0
    protected override void CreateCustomGUI()
    {
        GameObject prefab = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/Ultimate21ScoreBoard") as GameObject;

        scoreBoardPanel = CommonFunction.InstantiateObject(prefab, GameSystem.Instance.mClient.mUIManager.m_uiRootBasePanel.transform);
        UIGrid boardGrid = scoreBoardPanel.transform.FindChild("Pane/ScoreBoards").GetComponent <UIGrid>();

        scoreBoards[0]      = boardGrid.GetChild(0).gameObject;
        scoreBoards[1]      = CommonFunction.InstantiateObject(scoreBoards[0], boardGrid.transform);
        scoreBoards[1].name = "1";
        scoreBoards[2]      = CommonFunction.InstantiateObject(scoreBoards[0], boardGrid.transform);
        scoreBoards[2].name = "2";
        boardGrid.Reposition();
        Transform timerNode = scoreBoardPanel.transform.FindChild("Pane/TimerBoard");

        prefab     = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/TimerBoard") as GameObject;
        timerBoard = CommonFunction.InstantiateObject(prefab, timerNode).GetComponent <TimerBoard>();

        for (int i = 0; i < 3; ++i)
        {
            scoreBoards[i].transform.FindChild("Name").GetComponent <UILabel>().text = players[i].m_name;
        }

        prefab = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/ButtonBack") as GameObject;
        GameObject backButton = CommonFunction.InstantiateObject(prefab, scoreBoardPanel.transform);

        UIEventListener.Get(backButton).onClick = OnBack;
    }
示例#2
0
    void Awake()
    {
        digit     = transform.FindChild("Digit").GetComponent <UISprite>();
        timerNode = transform.FindChild("TimerNode");
        star[0]   = transform.FindChild("Star1").GetComponent <UIWidget>();
        star[1]   = transform.FindChild("Star2").GetComponent <UIWidget>();
        star[2]   = transform.FindChild("Star3").GetComponent <UIWidget>();

        GameObject prefab = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/TimerBoard") as GameObject;

        timerBoard = CommonFunction.InstantiateObject(prefab, timerNode).GetComponent <TimerBoard>();
        timerBoard.backgroundVisible = false;

        prefab = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/ButtonBack") as GameObject;
        GameObject goExit = CommonFunction.InstantiateObject(prefab, transform.FindChild("ButtonBack"));

        UIEventListener.Get(goExit).onClick = OnExit;
    }
示例#3
0
    void Awake()
    {
        leftNameLabel  = transform.FindChild("LeftName").GetComponent <UILabel>();
        rightNameLabel = transform.FindChild("RightName").GetComponent <UILabel>();
        leftUnits      = transform.FindChild("LeftScore/Units").GetComponent <UISprite>();
        leftTens       = transform.FindChild("LeftScore/Tens").GetComponent <UISprite>();
        leftHundreds   = transform.FindChild("LeftScore/Hundreds").GetComponent <UISprite>();
        leftThousands  = transform.FindChild("LeftScore/Thousands").GetComponent <UISprite>();
        rightUnits     = transform.FindChild("RightScore/Units").GetComponent <UISprite>();
        rightTens      = transform.FindChild("RightScore/Tens").GetComponent <UISprite>();
        rightHundreds  = transform.FindChild("RightScore/Hundreds").GetComponent <UISprite>();
        rightThousands = transform.FindChild("RightScore/Thousands").GetComponent <UISprite>();
        timerNode      = transform.FindChild("TimerNode");

        GameObject prefab = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/TimerBoard") as GameObject;

        timerBoard = CommonFunction.InstantiateObject(prefab, timerNode).GetComponent <TimerBoard>();
        timerBoard.backgroundVisible = false;

        prefab = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/ButtonBack") as GameObject;
        GameObject goExit = CommonFunction.InstantiateObject(prefab, transform.FindChild("ButtonBack"));

        UIEventListener.Get(goExit).onClick = OnExit;
    }