Esempio n. 1
0
 public void btnHomeEn()
 {
     //Log.d(LOG_TAG, "btnHomeEn " + rw.getStringByLanguage("HomeKey", "en", "US"));
     displayText = rw.getStringByLanguage("HomeKey", "en", "US");
     _text.text  = displayText;
 }
Esempio n. 2
0
    void Start()
    {
#if UNITY_EDITOR
        if (Application.isEditor)
        {
            return;
        }
#endif
        if (WaveVR.Instance == null)
        {
            Log.w(LOG_TAG, "Fail to initialize!");
            return;
        }

        wvrRes = WaveVR_Resource.instance;

        if (wvrRes == null)
        {
            Log.w(LOG_TAG, "Failed to initial WaveVR Resource instance!");
        }
        else
        {
            string lang    = wvrRes.getSystemLanguage();
            string country = wvrRes.getSystemCountry();
            Log.d(LOG_TAG, "system default language is " + lang);
            Log.d(LOG_TAG, "system default country is " + country);

            GameObject rt = GameObject.Find("ReloadText");
            if (rt != null)
            {
                Text reloadText = rt.GetComponent <Text>();
                reloadText.text = wvrRes.getStringByLanguage("reload_scene", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find reload scene text game object!");
            }

            GameObject mt = GameObject.Find("MainText");
            if (mt != null)
            {
                Text mainText = mt.GetComponent <Text>();
                mainText.text = wvrRes.getStringByLanguage("main_menu", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find main menu text game object!");
            }

            GameObject prt = GameObject.Find("PermReqText");
            if (prt != null)
            {
                Text permReqText = prt.GetComponent <Text>();
                permReqText.text = wvrRes.getStringByLanguage("perm_req", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find perm req text game object!");
            }

            GameObject qt = GameObject.Find("QuitText");
            if (qt != null)
            {
                Text quitText = qt.GetComponent <Text>();
                quitText.text = wvrRes.getStringByLanguage("exit", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find exit text game object!");
            }
        }

        pmInstance = WaveVR_PermissionManager.instance;
        if (pmInstance != null)
        {
            StartCoroutine(checkPackageManagerStatus());
        }
    }
Esempio n. 3
0
    public void selectTCLang()
    {
        if (rw == null)
        {
            Log.w(LOG_TAG, "Failed to initial WaveVR Resource instance!");
        }

        GameObject at = GameObject.Find("AllowText");

        if (at != null)
        {
            Text allowText = at.GetComponent <Text>();
            allowText.text = rw.getStringByLanguage("allow", "zh", "TW");
        }
        else
        {
            Log.w(LOG_TAG, "Could not find allow text game object!");
        }

        GameObject dt = GameObject.Find("DemoText");

        if (at != null)
        {
            Text demoText = dt.GetComponent <Text>();
            demoText.text = rw.getStringByLanguage("demo", "zh", "TW");
        }
        else
        {
            Log.w(LOG_TAG, "Could not find demo text game object!");
        }

        GameObject rt = GameObject.Find("RejectText");

        if (rt != null)
        {
            Text rejectText = rt.GetComponent <Text>();
            rejectText.text = rw.getStringByLanguage("reject", "zh", "TW");
        }
        else
        {
            Log.w(LOG_TAG, "Could not find reject text game object!");
        }

        GameObject tt = GameObject.Find("TestText");

        if (tt != null)
        {
            Text testText = tt.GetComponent <Text>();
            testText.text = rw.getStringByLanguage("test", "zh", "TW");
        }
        else
        {
            Log.w(LOG_TAG, "Could not find test text game object!");
        }
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        Log.d(LOG_TAG, "start()");
        rw = WaveVR_Resource.instance;

        Log.d(LOG_TAG, "system default language is " + rw.getSystemLanguage());
        Log.d(LOG_TAG, "system default country is " + rw.getSystemCountry());

        Log.d(LOG_TAG, "get string by system default language");

        string tmp = rw.getString("allow");

        Log.d(LOG_TAG, "get allow by system default language : " + tmp);

        tmp = rw.getString("demo");
        Log.d(LOG_TAG, "get demo by system default language : " + tmp);

        tmp = rw.getString("reject");
        Log.d(LOG_TAG, "get reject by system default language : " + tmp);

        tmp = rw.getString("test");
        Log.d(LOG_TAG, "get test by system default language : " + tmp);

        bool ret = rw.setPreferredLanguage("zh", "CN");

        Log.d(LOG_TAG, "set preferred lanuage to simplized chinese and get string = " + ret);

        tmp = rw.getString("allow");
        Log.d(LOG_TAG, "get allow by preferred lanuage(zhCN) : " + tmp);

        tmp = rw.getString("demo");
        Log.d(LOG_TAG, "get demo by preferred language(zhCN) : " + tmp);

        tmp = rw.getString("reject");
        Log.d(LOG_TAG, "get reject by preferred language(zhCN) : " + tmp);

        tmp = rw.getString("test");
        Log.d(LOG_TAG, "get test by preferred language(zhCN) : " + tmp);

        Log.d(LOG_TAG, "get string in dedicated language");
        tmp = rw.getStringByLanguage("demo", "zh", "TW");
        Log.d(LOG_TAG, "get demo by zhTW : " + tmp);
        tmp = rw.getStringByLanguage("demo", "en", "US");
        Log.d(LOG_TAG, "get demo by enUS : " + tmp);
        tmp = rw.getStringByLanguage("demo", "ja", "JP");
        Log.d(LOG_TAG, "get demo by jaJP : " + tmp);
        rw.getStringByLanguage("demo", "xx", "xx");
        Log.d(LOG_TAG, "get demo by xxxx: " + tmp);

        Log.d(LOG_TAG, "set back to default language ");
        rw.useSystemLanguage();

        tmp = rw.getString("allow");
        Log.d(LOG_TAG, "get allow from native : " + tmp);

        tmp = rw.getString("demo");
        Log.d(LOG_TAG, "get demo from native : " + tmp);

        tmp = rw.getString("reject");
        Log.d(LOG_TAG, "get reject from native : " + tmp);

        tmp = rw.getString("test");
        Log.d(LOG_TAG, "get test from native : " + tmp);
    }
    // Use this for initialization
    void Start()
    {
#if UNITY_EDITOR
        if (Application.isPlaying)
        {
            return;
        }
#endif
        rw = WaveVR_Resource.instance;

        resource2_AppKeyEN.text         = rw.getStringByLanguage("AppKey", "en", "US");
        resource2_HomeKeyEN.text        = rw.getStringByLanguage("HomeKey", "en", "US");
        resource2_TriggerKeyEN.text     = rw.getStringByLanguage("TriggerKey", "en", "US");
        resource2_TouchPadEN.text       = rw.getStringByLanguage("TouchPad", "en", "US");
        resource2_VolumeKeyEN.text      = rw.getStringByLanguage("VolumeKey", "en", "US");
        resource2_DigitalTriggerEN.text = rw.getStringByLanguage("DigitalTriggerKey", "en", "US");

        resource2_AppKeyCN.text         = rw.getStringByLanguage("AppKey", "zh", "CN");
        resource2_HomeKeyCN.text        = rw.getStringByLanguage("HomeKey", "zh", "CN");
        resource2_TriggerKeyCN.text     = rw.getStringByLanguage("TriggerKey", "zh", "CN");
        resource2_TouchPadCN.text       = rw.getStringByLanguage("TouchPad", "zh", "CN");
        resource2_VolumeKeyCN.text      = rw.getStringByLanguage("VolumeKey", "zh", "CN");
        resource2_DigitalTriggerCN.text = rw.getStringByLanguage("DigitalTriggerKey", "zh", "CN");

        resource2_AppKeyTW.text         = rw.getStringByLanguage("AppKey", "zh", "TW");
        resource2_HomeKeyTW.text        = rw.getStringByLanguage("HomeKey", "zh", "TW");
        resource2_TriggerKeyTW.text     = rw.getStringByLanguage("TriggerKey", "zh", "TW");
        resource2_TouchPadTW.text       = rw.getStringByLanguage("TouchPad", "zh", "TW");
        resource2_VolumeKeyTW.text      = rw.getStringByLanguage("VolumeKey", "zh", "TW");
        resource2_DigitalTriggerTW.text = rw.getStringByLanguage("DigitalTriggerKey", "zh", "TW");
    }
Esempio n. 6
0
    void Start()
    {
#if UNITY_EDITOR
        if (Application.isEditor)
        {
            return;
        }
#endif
        if (WaveVR.Instance == null)
        {
            Log.w(LOG_TAG, "Fail to initialize!");
            return;
        }

        wvrRes = WaveVR_Resource.instance;

        if (wvrRes == null)
        {
            Log.w(LOG_TAG, "Failed to initial WaveVR Resource instance!");
        }
        else
        {
            string lang    = wvrRes.getSystemLanguage();
            string country = wvrRes.getSystemCountry();
            Log.d(LOG_TAG, "system default language is " + lang);
            Log.d(LOG_TAG, "system default country is " + country);

            GameObject ht = GameObject.Find("SixDoFHText");
            if (ht != null)
            {
                Text htText = ht.GetComponent <Text>();
                htText.text = wvrRes.getStringByLanguage("sixdof_head", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find 6dof head text game object!");
            }

            GameObject gt = GameObject.Find("SixDoFGText");
            if (gt != null)
            {
                Text gtText = gt.GetComponent <Text>();
                gtText.text = wvrRes.getStringByLanguage("sixdof_ground", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find 6dof ground text game object!");
            }

            GameObject qt = GameObject.Find("QuitText");
            if (qt != null)
            {
                Text quitText = qt.GetComponent <Text>();
                quitText.text = wvrRes.getStringByLanguage("exit", lang, country);
            }
            else
            {
                Log.w(LOG_TAG, "Could not find exit text game object!");
            }
        }

        int    dof           = WaveVR.Instance.is6DoFTracking();
        Button Btn6DoFHead   = GameObject.Find("Btn6DoFHead").GetComponent <Button>();
        Button Btn6DoFGround = GameObject.Find("Btn6DoFGround").GetComponent <Button>();

        switch (dof)
        {
        case 3: {
            if (Btn6DoFHead != null)
            {
                Btn6DoFHead.interactable = false;
            }
            if (Btn6DoFGround != null)
            {
                Btn6DoFGround.interactable = false;
            }
        }
        break;

        case 6: {
            if (Btn6DoFHead != null)
            {
                Btn6DoFHead.interactable = true;
            }
            if (Btn6DoFGround != null)
            {
                Btn6DoFGround.interactable = true;
            }
        }
        break;

        default:
            break;
        }
    }