Zspace(笔触和UI按钮交互)

void Start(){

    //寻找ZCore预制体

    _zCore = GameObject.FindObjectOfType();

    //当物体为空的时候

     if (_zCore == null)

    {
         Debug.LogError("Unable to find reference to zSpace.Core.Core Monobehaviour.");
        //当前脚本关闭 并且跳出
          this.enabled = false;
          return;

    }

    //添加点击事件

    _zCore.TargetButtonPress += HandleButtonPress;

}

//2D按钮要执行的方法

public void HandleButtonPress(ZCore sendr,ZCore.TrackerButtonEventInfo info){
Debug.LogError ("点击了");
}

你可能感兴趣的:(zscape)