zoukankan      html  css  js  c++  java
  • Application.OpenURL()

    给大家推荐一个触控按钮直接跳转到指定网址的

    上代码

    using UnityEngine;
    using System.Collections;
    using TouchScript.Gestures;
    public class ApplicationONE : MonoBehaviour
    {
        string path = "http://www.cnblogs.com/unitySPK/";
        // Use this for initialization
        void OnEnable () {
            this.GetComponent<PressGesture>().Pressed += ApplicationONE_Pressed;
         }
    
        void ApplicationONE_Pressed(object sender, System.EventArgs e)
        {
            Application.OpenURL(path);
        }
        
        // Update is called once per frame
        void OnDisable () {
            this.GetComponent<PressGesture>().Pressed -= ApplicationONE_Pressed;
        }
    }

    那个OnEnable和OnDisable中的是一个添加点击的事件,用的是一个触屏插件TouchScript插件,这个插件挺好用的,下次给大家分享一下在项目如何运用的。

    最主要的代码就是一个指定的路径Path

    然后直接App了 OK了。

  • 相关阅读:
    pycharm快捷键
    Docker
    Go语言与Elasticsearch
    Celery与APScheduler
    爬虫入门到入狱
    数据分析
    后台管理
    Linux基础与自动化运维
    微信小程序
    Git
  • 原文地址:https://www.cnblogs.com/unitySPK/p/5086350.html
Copyright © 2011-2022 走看看