为什么OnMouseDown,Drag,Up在unity2d中不起作用?

时间:2018-07-10 13:51:58

标签: unity3d position gameobject

我创建了2D项目。和功能 OnMouseDown(),OnMouseDrag(),OnMouseUp()不起作用。

        StackLayout sl1 = this.FindByName<StackLayout>("myStackLayout");
        sl1.GestureRecognizers.Add(
        new TapGestureRecognizer()
        {
            Command = new Command(async () =>
            {
                sl1.BackgroundColor = Color.FromHex("#CCCCCC");

                await Task.Run(async () => { 
                    await Task.Delay(100);
                    Device.BeginInvokeOnMainThread(() => { 
                        sl1.BackgroundColor = Color.FromHex("#EEEEEE");
                    });
                });

            })
        });

0 个答案:

没有答案