Exemplo n.º 1
0
 /// <summary>
 /// 选中回调
 /// </summary>
 /// <param name="userData">User data.</param>
 void OnTools_OptimizeSelected(object userData)
 {
     if (onBindSuccessHandler != null)
     {
         onBindSuccessHandler.Invoke(currentGameObject, (int)userData);
     }
     onBindFailHandler = null;
     this.Close();
 }
Exemplo n.º 2
0
 void OnDestroy()
 {
     if (onBindFailHandler != null)
     {
         onBindFailHandler.Invoke();
     }
     onBindFailHandler    = null;
     currentGameObject    = null;
     onBindSuccessHandler = null;
 }
Exemplo n.º 3
0
    /// <summary>
    /// 显示绑定界面
    /// </summary>
    /// <param name="currentGameObject">Current game object.</param>
    public static MonsterDataBindEditor bind(GameObject currentGameObject, OnBindSuccessHandler onBindSuccessHandler, OnBindFailHandler onBindFailHandler)
    {
        if (MapEditorSceneModel.Instance.mapInfos.allmonster == null)
        {
            return(null);
        }
        Rect wr = new Rect(0, 0, 310, 260);
        MonsterDataBindEditor window = (MonsterDataBindEditor)EditorWindow.GetWindowWithRect(typeof(MonsterDataBindEditor), wr, true, "怪物数据绑定");

        window.currentGameObject    = currentGameObject;
        window.onBindFailHandler    = onBindFailHandler;
        window.onBindSuccessHandler = onBindSuccessHandler;
        window.Show();

        return(window);
    }