コード例 #1
0
    void Start()
    {
        if (Application.platform == RuntimePlatform.Android)
        {
            AndroidAPI.Init();
        }
        //UnityEngine.VR.VRSettings.renderScale = 1f;
        QualitySettings.masterTextureLimit = 0;
        path = Application.persistentDataPath + "/";

        //获取各组件
        m_Page            = GameObject.FindWithTag("Page").GetComponent <Text>();
        m_WarningText     = GameObject.FindWithTag("WarningText").GetComponent <Text>();
        m_BackgroundImage = GameObject.FindWithTag("WarningTextBg").GetComponent <Image>();
        m_TextTransform   = GameObject.FindWithTag("WarningTextTransform").GetComponent <Transform>();

        //三个页面组件
        GameObject p1 = GameObject.Find("Page1");
        GameObject p2 = GameObject.Find("Page2");
        GameObject p3 = GameObject.Find("Page3");

        pageGameObj.Clear();
        pageGameObj.Add(p1);
        pageGameObj.Add(p2);
        pageGameObj.Add(p3);

        //初始化分类
        initType();

        //加载分类的内容
        init();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        if (Application.platform == RuntimePlatform.Android)

        {
            AndroidAPI.Init();
        }
    }