コード例 #1
0
 static int GetValue(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ShareData obj  = (ShareData)ToLua.CheckObject(L, 1, typeof(ShareData));
         string    arg0 = ToLua.CheckString(L, 2);
         object    o    = obj.GetValue(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #2
0
ファイル: WorldMapCamera.cs プロジェクト: midgithub/sanguo
    protected override void OnClick(Transform obj)
    {
        Vector2 touchpos;

#if UNITY_STANDALONE || UNITY_EDITOR
        touchpos = Input.mousePosition;
#else
        touchpos = Input.GetTouch(0).position;
#endif
        int unit_index = -1;
        if (obj != null)
        {
            ShareData sd = obj.GetComponent <ShareData>();
            if (sd != null)
            {
                unit_index = Convert.ToInt32(sd.GetValue("unit_index"));
            }
        }
        object[] param = { obj, touchpos, unit_index };
        LuaFun.worldMapOnClick.Call(param);
    }