与Ngui一起调用Winphone方法

时间:2014-09-30 08:25:51

标签: c# windows-phone-8 unity3d ngui

我在团结中使用Ngui

我在NGui写过事件按钮OnClick

    void OnClick()
    {             
        if (gameObject.name == "More Game")
        {
            if (ShowMoreGame!= null)
            {
                ShowMoreGame(gameObject, EventArgs.Empty);
            }
        }
    }

在Winphone中,我编写了代码:

    private void Unity_Loaded()
    {  
        Menuclick more = (Menuclick)UnityEngine.Object.FindObjectOfType(typeof(Menuclick));
        more.ShowMoreGame+= lisGame;
    }

    void lisGame(object sender, EventArgs e)
    {
        this.Dispatcher.BeginInvoke(delegate
        {
            MarketplaceSearchTask mkSearch = new MarketplaceSearchTask();                
            mkSearch.SearchTerms = "dev";
            mkSearch.Show();

        });
    }

它不能正常工作

0 个答案:

没有答案