Exemplo n.º 1
0
    public void StartScene(BateMain masterclass)
    {
        main = masterclass;
        main.Trace("Menu Manager: StartScene!");

        background       = GameObject.Find("menuBg");
        bgAssetUrl       = main.AddPlatformAndQualityToUrl(bgAssetUrl);
        backgroundTitle  = GameObject.Find("menuTitle");
        titleAssetUrl    = main.AddPlatformAndQualityToUrl(titleAssetUrl);
        btJogar          = GameObject.Find("menuBtJogar");
        btJogarAssetUrl  = main.AddPlatformAndQualityToUrl(btJogarAssetUrl);
        btVoltar         = GameObject.Find("menuBtVoltar");
        btVoltarAssetUrl = main.AddPlatformAndQualityToUrl(btVoltarAssetUrl);

        background.transform.SetParent(main.uiCanvas.transform);
        backgroundTitle.transform.SetParent(main.uiCanvas.transform);
        btJogar.transform.SetParent(main.uiCanvas.transform);
        btVoltar.transform.SetParent(main.uiCanvas.transform);

        background.GetComponent <Image>().sprite      = Resources.Load <Sprite>(bgAssetUrl);
        backgroundTitle.GetComponent <Image>().sprite = Resources.Load <Sprite>(titleAssetUrl);
        btJogar.GetComponent <Image>().sprite         = Resources.Load <Sprite>(btJogarAssetUrl);
        btJogar.GetComponent <Button>().onClick.AddListener(OnBtJogarClick);
        btVoltar.GetComponent <Image>().sprite = Resources.Load <Sprite>(btVoltarAssetUrl);
        btVoltar.GetComponent <Button>().onClick.AddListener(OnBtVoltarClick);
    }
Exemplo n.º 2
0
    public void StartScene(BateMain masterclass = null, int playerNum = 1)
    {
        main         = masterclass;
        playerNumber = playerNum;
        VerifyScreenRes();
        CreateBackGround();
        CreateWalls();
        CreateUI();
        CreateBall();
        CreatePaddles();
        CreateTouches();

        //wallNorth = GameObject.Find("wallNorth");
        //wallSouth = GameObject.Find("wallSouth");
        //wallLeft = GameObject.Find("wallLeft");
        //wallRight = GameObject.Find("wallRight");
    }
Exemplo n.º 3
0
    public void StartScene(BateMain masterclass)
    {
        main = masterclass;
        main.Trace("Selection Manager: StartScene!");

        background = GameObject.Find("BG");
        bgAssetUrl = main.AddPlatformAndQualityToUrl(bgAssetUrl);
        background.GetComponent <Image>().sprite = Resources.Load <Sprite>(bgAssetUrl);
        background.transform.SetParent(main.uiCanvas.transform);

        btP1       = GameObject.Find("onePBtn");
        p1AssetUrl = main.AddPlatformAndQualityToUrl(p1AssetUrl);
        btP1.GetComponent <Image>().sprite = Resources.Load <Sprite>(p1AssetUrl);
        btP1.GetComponent <Button>().onClick.AddListener(OnClickP1);
        btP1.transform.SetParent(main.uiCanvas.transform);

        btP2       = GameObject.Find("twoPBtn");
        p2AssetUrl = main.AddPlatformAndQualityToUrl(p2AssetUrl);
        btP2.GetComponent <Image>().sprite = Resources.Load <Sprite>(p2AssetUrl);
        btP2.GetComponent <Button>().onClick.AddListener(OnClickP2);
        btP2.transform.SetParent(main.uiCanvas.transform);
    }