Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        Button btnBack = GetComponent <Button>();

        GUIKit.InitButtonOnClick(btnBack, () =>
        {
            BackMain();
        });
    }
Esempio n. 2
0
    private void InitView()
    {
        terminalView  = transform.Find("DemoCanvas/DemoPanel/TerminalView").GetComponent <TerminalView>();
        scrollContent = transform.Find("DemoCanvas/DemoPanel/DemoScrollView/Viewport/Content");

        EnumDemoButton = scrollContent.Find("EnumDemo").GetComponent <Button>();
        enumDemo       = EnumDemoButton.GetComponent <EnumDemo>();

        ToastDemoButton = scrollContent.Find("ToastDemo").GetComponent <Button>();
        toastDemo       = ToastDemoButton.GetComponent <ToastDemo>();


        TamRecyclerViewDemoButton = scrollContent.Find("TamRecyclerViewDemo").GetComponent <Button>();
        tamRecyclerViewDemo       = TamRecyclerViewDemoButton.GetComponent <TamRecyclerViewDemo>();

        GridButton       = TamRecyclerViewDemoButton.transform.Find("Layout/GridButton").GetComponent <Button>();
        VerticalButton   = TamRecyclerViewDemoButton.transform.Find("Layout/VerticalButton").GetComponent <Button>();
        HorizontalButton = TamRecyclerViewDemoButton.transform.Find("Layout/HorizontalButton").GetComponent <Button>();

        Pano360DemoButton = scrollContent.Find("Pano360Demo").GetComponent <Button>();
        pano360Demo       = Pano360DemoButton.GetComponent <Pano360Demo>();

        AutoRotateDemoButton = scrollContent.Find("AutoRotateDemo").GetComponent <Button>();

        DrawOutlineDemoButton = scrollContent.Find("DrawOutlineDemo").GetComponent <Button>();

        TamNumParticleDemoButton = scrollContent.Find("TamNumParticleDemo").GetComponent <Button>();

        TamTemperatureDemoButton = scrollContent.Find("TamTemperatureDemo").GetComponent <Button>();

        TamExitDemoButton = scrollContent.Find("TamExitDemo").GetComponent <Button>();

        GUIKit.InitButtonOnClick(EnumDemoButton, () =>
        {
            enumDemo.Test();
            tamRecyclerViewDemo.DismissRecyclerView();
        });

        GUIKit.InitButtonOnClick(ToastDemoButton, () =>
        {
            toastDemo.OnClickBtn();
            tamRecyclerViewDemo.DismissRecyclerView();
        });

        GUIKit.InitButtonOnClick(TamRecyclerViewDemoButton, () =>
        {
            tamRecyclerViewDemo.ShowRecyclerView();
        });
        GUIKit.InitButtonOnClick(GridButton, () =>
        {
            tamRecyclerViewDemo.SetRecyclerViewType(TamRecyclerView.RecyclerViewType.Grid);
            tamRecyclerViewDemo.ShowRecyclerView();
        });
        GUIKit.InitButtonOnClick(VerticalButton, () =>
        {
            tamRecyclerViewDemo.SetRecyclerViewType(TamRecyclerView.RecyclerViewType.Vertical);
            tamRecyclerViewDemo.ShowRecyclerView();
        });
        GUIKit.InitButtonOnClick(HorizontalButton, () =>
        {
            tamRecyclerViewDemo.SetRecyclerViewType(TamRecyclerView.RecyclerViewType.Horizontal);
            tamRecyclerViewDemo.ShowRecyclerView();
        });

        GUIKit.InitButtonOnClick(Pano360DemoButton, () =>
        {
            pano360Demo.OnClickEvent();
        });

        GUIKit.InitButtonOnClick(AutoRotateDemoButton, () =>
        {
            SceneManager.LoadScene("TamEffectScene");
        });

        GUIKit.InitButtonOnClick(DrawOutlineDemoButton, () =>
        {
            SceneManager.LoadScene("TamDrawOutline");
        });

        GUIKit.InitButtonOnClick(TamNumParticleDemoButton, () =>
        {
            SceneManager.LoadScene("TamNumParticleScene");
        });

        GUIKit.InitButtonOnClick(TamTemperatureDemoButton, () =>
        {
            SceneManager.LoadScene("TamTemperatureScene");
        });

        GUIKit.InitButtonOnClick(TamExitDemoButton, () =>
        {
            GameManager.Instance.ExitGame();
        });
    }