当使用DLL形式的插件时,因为DLL默认是为移动平台编译的,所以不支持复制粘贴。 将这个脚本放到工程里,并在游戏启动时调用CopyPastePatch.Apply(),可以在PC平台激活复制粘贴功能
示例#1
0
        void DoCopy(string value)
        {
#if UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
            CopyPastePatch.OnCopy(this, value);
#else
            if (onCopy != null)
            {
                onCopy(this, value);
            }
#endif
        }
 static public int constructor(IntPtr l)
 {
     try {
         FairyGUI.CopyPastePatch o;
         o = new FairyGUI.CopyPastePatch();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#3
0
        public Stage()
            : base()
        {
            _inst       = this;
            soundVolume = 1;

            _updateContext     = new UpdateContext();
            stageWidth         = Screen.width;
            stageHeight        = Screen.height;
            _frameGotHitTarget = -1;

            touchScreen = Input.touchSupported;

            _touches = new TouchInfo[5];
            for (int i = 0; i < _touches.Length; i++)
            {
                _touches[i] = new TouchInfo();
            }

            if (!touchScreen)
            {
                _touches[0].touchId = 0;
            }

            _rollOutChain  = new List <DisplayObject>();
            _rollOverChain = new List <DisplayObject>();

            onStageResized = new EventListener(this, "onStageResized");
            onTouchMove    = new EventListener(this, "onTouchMove");
            onCopy         = new EventListener(this, "onCopy");
            onPaste        = new EventListener(this, "onPaste");

            StageEngine engine = GameObject.FindObjectOfType <StageEngine>();

            if (engine != null)
            {
                this.gameObject = engine.gameObject;
            }
            else
            {
                int layer = LayerMask.NameToLayer(StageCamera.LayerName);

                this.gameObject           = new GameObject("Stage");
                this.gameObject.hideFlags = HideFlags.None;
                this.gameObject.layer     = layer;
                this.gameObject.AddComponent <StageEngine>();
                this.gameObject.AddComponent <UIContentScaler>();
            }
            this.cachedTransform            = gameObject.transform;
            this.cachedTransform.localScale = new Vector3(StageCamera.UnitsPerPixel, StageCamera.UnitsPerPixel, StageCamera.UnitsPerPixel);
            this.gameObject.SetActive(true);
            UnityEngine.Object.DontDestroyOnLoad(this.gameObject);

            EnableSound();

            inputCaret  = new InputCaret();
            highlighter = new Highlighter();

            Timers.inst.Add(5, 0, RunTextureCollector);

#if UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
            CopyPastePatch.Apply();
#endif
        }