SetText() public static method

public static SetText ( string str ) : void
str string
return void
示例#1
0
    private void OnEnable()
    {
        if (_input == null)
        {
            _input = GetComponent <InputField>();
        }

        var message = JsonUtility.ToJson(songsManager.CurrentSong);
        var bytes   = Encoding.UTF8.GetBytes(message);

        _input.text = _deeplink + Convert.ToBase64String(bytes);

        UniClipboard.SetText(_input.text);

        //var encoded = new Texture2D(256, 256);
        //var color32 = Encode(message, encoded.width, encoded.height);
        //encoded.SetPixels32(color32);
        //encoded.Apply();

        //if(_rawImage == null)
        //{
        //	_rawImage = GetComponent<RawImage>();
        //}

        //_rawImage.texture = encoded;
    }
        private void DrawContentGUI(string label, string content)
        {
            EditorLayoutTools.DrawLabelWithBackground(label, new Color(0.3f, 0.3f, 0.5f), new Color(0.8f, 0.8f, 0.8f, 0.8f));

            using (new EditorGUILayout.HorizontalScope())
            {
                using (new EditorGUILayout.VerticalScope())
                {
                    if (GUILayout.Button("copy", GUILayout.Width(45f), GUILayout.Height(18f)))
                    {
                        UniClipboard.SetText(content);
                    }

                    GUILayout.Space(2f);
                }

                var textStyle = new GUIStyle();
                var textSize  = textStyle.CalcSize(new GUIContent(content));

                var originLabelWidth = EditorLayoutTools.SetLabelWidth(textSize.x);

                GUILayout.Label(content, GUILayout.Height(20f));

                EditorLayoutTools.SetLabelWidth(originLabelWidth);

                GUILayout.FlexibleSpace();
            }
        }
示例#3
0
    void ShowGUI(int windowID)
    {
        GUI.Label(new Rect(60, 80, 300, 100), "Your Code for this circuit : " + generalCode);


        if (GUI.Button(new Rect(60, 150, 75, 30), "OK"))
        {
            showPopUp = false;
        }

        if (GUI.Button(new Rect(180, 150, 75, 30), "Copy"))
        {
            UniClipboard.SetText(generalCode);
        }
        if (GUI.Button(new Rect(50, 200, 75, 30), "Save1"))
        {
            SaveSystem.instance.saveCode = generalCode;
            SaveSystem.instance.Save(1);
        }
        if (GUI.Button(new Rect(150, 200, 75, 30), "Save2"))
        {
            SaveSystem.instance.saveCode = generalCode;
            SaveSystem.instance.Save(2);
        }
        if (GUI.Button(new Rect(250, 200, 75, 30), "Save3"))
        {
            SaveSystem.instance.saveCode = generalCode;
            SaveSystem.instance.Save(3);
        }
    }
示例#4
0
    public void CopyLink()
    {
#if UNITY_IOS
        UniClipboard.SetText(Constants.ShareURLLink(Constants.ShareCodes.CopyLink));
#endif

#if UNITY_ANDROID
        UniClipboard.SetText(Constants.ShareURLLink(Constants.ShareCodes.CopyLink));
#endif

        if (!Debug.isDebugBuild)
        {
            Flurry.Flurry.Instance.LogEvent("Share_CopyLink");
            Fabric.Answers.Answers.LogInvite("CopyLink");
            Fabric.Answers.Answers.LogShare("CopyLink", contentId: "Invite");
        }

        DialogManager.Instance.Show(prefabName: "GeneralMessageOkButton",
                                    title: LocaliseText.Get("Invite.CopyLinkTitle"),
                                    text: LocaliseText.Get("Invite.CopyLinkText"),
                                    dialogButtons: DialogInstance.DialogButtonsType.Ok, doneCallback: (DialogInstance dialog) =>
        {
#if UNITY_EDITOR
            InviteBonusCoins();
#endif
        });
    }
示例#5
0
 public void copy()
 {
     //int linkmode = (int)GameManager.GameMode;
     UniClipboard.SetText("http://www.noranapps.com/ofl.php?mode=");
     //UniClipboard.GetText();
     Debug.Log(UniClipboard.GetText() + "1234567");
     showToast("Link Copied", 2);
 }
示例#6
0
 /// <summary>
 /// Copies the database key to clipboard and returns it
 /// </summary>
 /// <returns></returns>
 public string OnShare()
 {
     if (!Active)
     {
         return(null);
     }
     UniClipboard.SetText(m_buildSM.CurrentTrackData.m_dbKey);
     return(m_buildSM.CurrentTrackData.m_dbKey);
 }
    IEnumerator copyIDAndMessage()
    {
        UniClipboard.SetText(UserData.UserPlayFabId);
        AndroidSet.instance.ShowToast("ID 복사 완료");

        yield return(new WaitForSeconds(2f));

        AndroidSet.instance.CancelToast();
    }
        public void CopyCoordinates()
        {
            UniClipboard.SetText(
                string.Format(
                    "{0}, {1}",
                    latitudeText.text,
                    longtitudeText.text));

            ShowMessage("Coordinates copied to clipboard");
        }
        public void Share()
        {
            var shareText = messageText.text;

#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
            (new NativeShare()).SetText(shareText).Share();
#else
            UniClipboard.SetText(shareText);
#endif
        }
        public void Share()
        {
            string shareText = GetDeckText();

#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
            (new NativeShare()).SetText(shareText).Share();
#else
            UniClipboard.SetText(shareText);
            CardGameManager.Instance.Messenger.Show(DeckSaveMenu.DeckCopiedMessage);
#endif
        }
示例#11
0
        public void Share()
        {
            var shareText = textOutputArea.text;

#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
            (new NativeShare()).SetText(shareText).Share();
#else
            UniClipboard.SetText(shareText);
            CardGameManager.Instance.Messenger.Show(DeckCopiedMessage);
#endif
        }
示例#12
0
        public void CopySettingsToClipboard()
        {
            string clipboardText = "";
            List <DebugSlider.JSONData> sliderJsons = new List <DebugSlider.JSONData>();

            for (int i = 0; i < sliders.Count; i++)
            {
                sliderJsons.Add(sliders[i].GetJSON);
            }
            sliderData    = new SliderData(sliderJsons);
            clipboardText = JsonUtility.ToJson(sliderData);
            UnityEngine.Debug.Log(clipboardText);
            UniClipboard.SetText(clipboardText);
        }
示例#13
0
    public void SubmitCode()
    {
        if (!isWindow)
        {
            return;
        }
        Close();
        if (copyMode)
        {
            UniClipboard.SetText(inputField.text);
        }

        SingleTon.instance.dollPresetList.presets[0]
        .DataToGrid(DataManager.Decrypt(inputField.text));
    }
        public void Share()
        {
            try
            {
                var shareText = File.ReadAllText(_selectedFilePath);
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
                (new NativeShare()).SetText(shareText).Share();
#else
                UniClipboard.SetText(shareText);
                CardGameManager.Instance.Messenger.Show(DeckSaveMenu.DeckCopiedMessage);
#endif
            }
            catch (Exception e)
            {
                Debug.LogError(DeckLoadErrorMessage + e.Message);
                CardGameManager.Instance.Messenger.Show(DeckLoadErrorMessage + e.Message);
            }
        }
示例#15
0
    private void ShowBackupView(BackupType backupType)
    {
        backupView.SetActive(true);
        GameObject keystoreText   = backupView.transform.Find("TextKeystore").gameObject;
        GameObject privateKeyText = backupView.transform.Find("TextPrivateKey").gameObject;
        GameObject wordsText      = backupView.transform.Find("TextWords").gameObject;
        Text       contentText    = backupView.transform.Find("Text").GetComponent <Text>();
        Button     btnConfirm     = backupView.transform.Find("BtnConfirm").GetComponent <Button>();
        Button     btnCopy        = backupView.transform.Find("BtnCopy").GetComponent <Button>();

        keystoreText.SetActive(false);
        privateKeyText.SetActive(false);
        wordsText.SetActive(false);
        contentText.text = "";
        if (backupType == BackupType.Keystore)
        {
            keystoreText.SetActive(true);
            contentText.text = mKeystore;
        }
        else if (backupType == BackupType.PrivateKey)
        {
            privateKeyText.SetActive(true);
            contentText.text = mPrivateKeyString;
        }
        else if (backupType == BackupType.Words)
        {
            wordsText.SetActive(true);
            contentText.text = string.Join(" ", mWords);
        }
        AddButtonClickEvent(btnConfirm, delegate() {
            backupView.SetActive(false);
            ShowSettingView();
        });

        AddButtonClickEvent(btnCopy, delegate() {
            UniClipboard.SetText(contentText.text);
        });
    }
示例#16
0
    private void ShowBackupView(BackupType backupType)
    {
        ViewManager.ReplaceView(backupView, gameObject.name);
        GameObject keystoreText   = backupView.transform.Find("TextKeystore").gameObject;
        GameObject privateKeyText = backupView.transform.Find("TextPrivateKey").gameObject;
        GameObject wordsText      = backupView.transform.Find("TextWords").gameObject;
        Text       contentText    = backupView.transform.Find("Text").GetComponent <Text>();
        Button     btnClose       = backupView.transform.Find("BtnClose").GetComponent <Button>();
        Button     btnCopy        = backupView.transform.Find("BtnCopy").GetComponent <Button>();

        keystoreText.SetActive(false);
        privateKeyText.SetActive(false);
        wordsText.SetActive(false);
        contentText.text = "";
        if (backupType == BackupType.Keystore)
        {
            keystoreText.SetActive(true);
            contentText.text = AccountManager.Instance.GetKeytore();
        }
        else if (backupType == BackupType.PrivateKey)
        {
            privateKeyText.SetActive(true);
            contentText.text = AccountManager.Instance.GetPrivateKey();
        }
        else if (backupType == BackupType.Words)
        {
            wordsText.SetActive(true);
            contentText.text = string.Join(" ", AccountManager.Instance.GetWords());
        }
        Utils.AddButtonClickEvent(btnClose, delegate() {
            ShowSettingView();
        });

        Utils.AddButtonClickEvent(btnCopy, delegate() {
            UniClipboard.SetText(contentText.text);
            ViewManager.ShowTip("复制成功");
        });
    }
    async void Init()
    {
        string id = await GetFirebaseInstanceId();

        if (Debug.isDebugBuild && showFirebaseInstanceId)
        {
            UniClipboard.SetText(id);
            //Manager.Add(PopupController.POPUP_SCENE_NAME, new PopupData(PopupType.OK, System.String.Format("Instance ID Token {0}", id)));
        }
        if (FirebaseManager.FirebaseReady)
        {
            Debug.Log($"Firebase ready: {FirebaseManager.FirebaseReady}");
            SetDefaultValues();
            initSuccess = true;
        }
        FetchData();

        if (Debug.isDebugBuild)
        {
            var setting = FirebaseRemoteConfig.Settings;
            setting.IsDeveloperMode = true;
        }
    }
示例#18
0
 // Start is called before the first frame update
 void Start()
 {
     UniClipboard.SetText("test");
 }
示例#19
0
 void Awake()
 {
     _copyButton.onClick.AddListener(() => {
         UniClipboard.SetText(_input.text);
     });
 }
示例#20
0
 private void OnBtnCopyRoomName()
 {
     UniClipboard.SetText(txtRoomName.text);
     Debug.Log($"{txtRoomName.text} copied to clipboard");
 }
示例#21
0
文件: Util.cs 项目: mengtest/wh
 /// <summary>
 /// 复制文本
 /// </summary>
 public static void CopyText(string str)
 {
     Debug.Log("=============CopyText " + str);
     UniClipboard.SetText(str);
     Debug.Log(UniClipboard.GetText());
 }
示例#22
0
 public void CopyToClipboard()
 {
     textVal = objText.text.ToString();
     UniClipboard.SetText(textVal);
     // text.CopyToClipboard();
 }
示例#23
0
 void OnCopyClick(GameObject go)
 {
     UniClipboard.SetText(urlList.value);
     msgSignal.Dispatch(new MsgPara("复制链接成功", 2));
 }
示例#24
0
    private void ShowInfoView()
    {
        ViewManager.ReplaceView(infoView, gameObject.name);

        Text nickName = infoView.transform.Find("NickName").GetComponent <Text>();
        Text money    = infoView.transform.Find("Money").GetComponent <Text>();
        Text address  = infoView.transform.Find("Address").GetComponent <Text>();
        Text keystore = infoView.transform.Find("Panel/Keystore").GetComponent <Text>();

        nickName.text = AccountManager.Instance.GetNickName();
        address.text  = AccountManager.Instance.GetAddress();
        keystore.text = AccountManager.Instance.GetKeytore();

        Button btnCopyAddress = infoView.transform.Find("BtnCopyAddress").GetComponent <Button>();

        Utils.AddButtonClickEvent(btnCopyAddress, delegate(){
            UniClipboard.SetText(AccountManager.Instance.GetAddress());
            ViewManager.ShowTip("复制成功");
        });

        money.text = "正在请求刷新";
        AccountManager.Instance.UpdateBalance((balance) => {
            money.text = balance.ToString("0.0000");
        });

        AccountJsonInfo mAccountJsonInfo = AccountManager.Instance.GetAccounts();

        for (int i = 0; i < mAccountJsonInfo.accountInfos.Count; i++)
        {
            AccountInfo ai = mAccountJsonInfo.accountInfos[i];
            if (ai.address == AccountManager.Instance.GetAddress())
            {
                mCurrentAccountIdx = i;
                break;
            }
        }

        // netdropdown
        Dropdown urlDropDown = infoView.transform.Find("NetDropdown").GetComponent <Dropdown>();

        urlDropDown.options.Clear();
        Dropdown.OptionData tempData;
        for (int i = 0; i < AccountManager.Instance.netNames.Length; i++)
        {
            tempData = new Dropdown.OptionData(AccountManager.Instance.netNames[i]);
            urlDropDown.options.Add(tempData);
        }
        urlDropDown.captionText.text = AccountManager.Instance.GetCurrentNetName();
        urlDropDown.onValueChanged.RemoveAllListeners();
        urlDropDown.onValueChanged.AddListener(delegate(int value) {
            UnityEngine.Debug.Log("点击了value " + value);
            AccountManager.Instance.SwitchNet(value);
            // 更新资产
            money.text = "正在请求刷新";
            AccountManager.Instance.UpdateBalance((balance) => {
                money.text = balance.ToString("0.0000");
            });
        });
        // namedropdown
        Dropdown nameDropDown = infoView.transform.Find("NameDropdown").GetComponent <Dropdown>();

        nameDropDown.options.Clear();
        for (int i = 0; i < mAccountJsonInfo.accountInfos.Count; i++)
        {
            tempData = new Dropdown.OptionData(mAccountJsonInfo.accountInfos[i].name);
            nameDropDown.options.Add(tempData);
        }
        nameDropDown.value            = mCurrentAccountIdx;
        nameDropDown.captionText.text = mAccountJsonInfo.accountInfos[mCurrentAccountIdx].name;
        nameDropDown.onValueChanged.RemoveAllListeners();
        nameDropDown.onValueChanged.AddListener(delegate(int value) {
            UnityEngine.Debug.Log("点击了nameDropDown value " + value);
            mCurrentAccountIdx = value;
            AccountManager.Instance.SwitchAccount(mCurrentAccountIdx);
            ShowInfoView();
        });


        // Button btnCopyPrivateKey = infoView.transform.Find("BtnCopyPrivateKey").GetComponent<Button>();
        // Utils.AddButtonClickEvent(btnCopyPrivateKey, delegate(){
        //  UniClipboard.SetText(mPrivateKeyString);
        // });
        // Button btnCopyKeystore = infoView.transform.Find("BtnCopyKeystore").GetComponent<Button>();
        // Utils.AddButtonClickEvent(btnCopyKeystore, delegate(){
        //  UniClipboard.SetText(mKeystore);
        // });
        Button btnLogout = infoView.transform.Find("BtnLogout").GetComponent <Button>();

        Utils.AddButtonClickEvent(btnLogout, delegate(){
            Logout();
        });
        Button btnTransfer = infoView.transform.Find("BtnTransfer").GetComponent <Button>();

        Utils.AddButtonClickEvent(btnTransfer, delegate(){
            ShowTransferView();
        });
        Button btnNewAccount = infoView.transform.Find("NewAccount").GetComponent <Button>();

        Utils.AddButtonClickEvent(btnNewAccount, delegate(){
            ShowSelectView();
        });

        Button btnSetting = infoView.transform.Find("BtnSetting").GetComponent <Button>();

        Utils.AddButtonClickEvent(btnSetting, delegate(){
            ShowSettingView();
        });
    }
示例#25
0
 public void CopySeedBt()
 {
     UniClipboard.SetText(seedText.text);
     SceneManager.LoadScene(0);
 }
示例#26
0
 public void Start()
 {
     text = txt.text.ToString();
     UniClipboard.SetText(text);
     // text.CopyToClipboard();
 }
示例#27
0
    void SetText()
    {
        var text = _setTextInputField.text;

        UniClipboard.SetText(text);
    }
示例#28
0
    private void ShowInfoView()
    {
        infoView.SetActive(true);
        Text nickName = infoView.transform.Find("NickName").GetComponent <Text>();
        Text money    = infoView.transform.Find("Money").GetComponent <Text>();
        Text address  = infoView.transform.Find("Address").GetComponent <Text>();
        Text keystore = infoView.transform.Find("Panel/Keystore").GetComponent <Text>();

        nickName.text = mNickName;
        address.text  = mAddress;
        keystore.text = mKeystore;

        Button btnCopyAddress = infoView.transform.Find("BtnCopyAddress").GetComponent <Button>();

        AddButtonClickEvent(btnCopyAddress, delegate(){
            UniClipboard.SetText(mAddress);
        });

        money.text = "正在请求刷新";
        StartCoroutine(Wallet.GetBalance(mAddress, (balance) => {
            money.text = balance.ToString();
        }));

        for (int i = 0; i < mAccountJsonInfo.accountInfos.Count; i++)
        {
            AccountInfo ai = mAccountJsonInfo.accountInfos[i];
            if (ai.address == mAddress)
            {
                mCurrentAccountIdx = i;
                break;
            }
        }

        // netdropdown
        Dropdown urlDropDown = infoView.transform.Find("NetDropdown").GetComponent <Dropdown>();

        urlDropDown.options.Clear();
        Dropdown.OptionData tempData;
        for (int i = 0; i < urlNames.Length; i++)
        {
            tempData = new Dropdown.OptionData(urlNames[i]);
            urlDropDown.options.Add(tempData);
        }
        urlDropDown.captionText.text = urlNames[mCurrentNet];
        urlDropDown.onValueChanged.RemoveAllListeners();
        urlDropDown.onValueChanged.AddListener(delegate(int value) {
            UnityEngine.Debug.Log("点击了value " + value);
            Wallet.SetUrl(lineUrls[urlNames[value]]);
            mCurrentNet = value;
            // 更新资产
            money.text = "正在请求刷新";
            StartCoroutine(Wallet.GetBalance(mAddress, (balance) => {
                Debug.Log("Account balance: " + balance);
                money.text = balance.ToString();
            }));
        });
        // namedropdown
        Dropdown nameDropDown = infoView.transform.Find("NameDropdown").GetComponent <Dropdown>();

        nameDropDown.options.Clear();
        for (int i = 0; i < mAccountJsonInfo.accountInfos.Count; i++)
        {
            tempData = new Dropdown.OptionData(mAccountJsonInfo.accountInfos[i].name);
            nameDropDown.options.Add(tempData);
        }
        nameDropDown.value            = mCurrentAccountIdx;
        nameDropDown.captionText.text = mAccountJsonInfo.accountInfos[mCurrentAccountIdx].name;
        nameDropDown.onValueChanged.RemoveAllListeners();
        nameDropDown.onValueChanged.AddListener(delegate(int value) {
            UnityEngine.Debug.Log("点击了nameDropDown value " + value);
            mCurrentAccountIdx = value;
            AccountInfo ai     = mAccountJsonInfo.accountInfos[mCurrentAccountIdx];
            mNickName          = ai.name;
            mKeystore          = ai.keystore;
            mAddress           = ai.address;
            mPassword          = ai.password;
            mPrivateKeyString  = ai.privateKey;
            if (!string.IsNullOrEmpty(ai.words))
            {
                mWords = ai.words.Split(' ');
            }
            else
            {
                mWords = null;
            }
            ShowInfoView();
        });


        // Button btnCopyPrivateKey = infoView.transform.Find("BtnCopyPrivateKey").GetComponent<Button>();
        // AddButtonClickEvent(btnCopyPrivateKey, delegate(){
        //  UniClipboard.SetText(mPrivateKeyString);
        // });
        // Button btnCopyKeystore = infoView.transform.Find("BtnCopyKeystore").GetComponent<Button>();
        // AddButtonClickEvent(btnCopyKeystore, delegate(){
        //  UniClipboard.SetText(mKeystore);
        // });
        Button btnLogout = infoView.transform.Find("BtnLogout").GetComponent <Button>();

        AddButtonClickEvent(btnLogout, delegate(){
            infoView.SetActive(false);
            Logout();
        });
        Button btnTransfer = infoView.transform.Find("BtnTransfer").GetComponent <Button>();

        AddButtonClickEvent(btnTransfer, delegate(){
            infoView.SetActive(false);
            ShowTransferView();
        });
        Button btnNewAccount = infoView.transform.Find("NewAccount").GetComponent <Button>();

        AddButtonClickEvent(btnNewAccount, delegate(){
            infoView.SetActive(false);
            ShowSelectView();
        });

        Button btnSetting = infoView.transform.Find("BtnSetting").GetComponent <Button>();

        AddButtonClickEvent(btnSetting, delegate(){
            infoView.SetActive(false);
            ShowSettingView();
        });
    }
 public void ShareUrl()
 {
     UniClipboard.SetText(Current.AutoUpdateUrl);
     Messenger.Show(string.Format(ShareUrlMessage, Current.Name, Current.AutoUpdateUrl));
 }
 private void ShareUrl()
 {
     UniClipboard.SetText(Current.AutoUpdateUrl?.OriginalString ?? string.Empty);
     Messenger.Show(string.Format(ShareUrlMessage, Current.Name, Current.AutoUpdateUrl));
 }