当前位置: 首页>>代码示例>>C#>>正文


C# ILuaState.PushBoolean方法代码示例

本文整理汇总了C#中ILuaState.PushBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.PushBoolean方法的具体用法?C# ILuaState.PushBoolean怎么用?C# ILuaState.PushBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILuaState的用法示例。


在下文中一共展示了ILuaState.PushBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WidgetReadOper

        protected override bool WidgetReadOper(ILuaState lua, string key)
        {
            switch (key)
            {
                case "speed":
                    lua.PushNumber(_speed);
                    return true;
                case "dwMMethod":
                    lua.PushInteger(_dwMMethod);
                    return true;
                case "bMoving":
                    lua.PushBoolean(_bMoving);
                    return true;
                case "fUpdateInterval":
                    lua.PushNumber(_fUpdateInterval);
                    return true;
                case "fAnimSpeed":
                    if (_animator)
                    {
                        lua.PushNumber(_animator.speed);
                    }
                    else
                    {
                        lua.PushNumber(0);
                    }
                    return true;
            }

            return base.WidgetReadOper(lua, key);
        }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:30,代码来源:Actor.cs

示例2: CO_Resume

		private static int CO_Resume( ILuaState lua )
		{
			ILuaState co = lua.ToThread( 1 );
			lua.L_ArgCheck( co != null, 1, "coroutine expected" );
			int r = AuxResume( lua, co, lua.GetTop() - 1 );
			if( r < 0 )
			{
				lua.PushBoolean( false );
				lua.Insert( -2 );
				return 2; // return false + error message
			}
			else
			{
				lua.PushBoolean( true );
				lua.Insert( -(r+1) );
				return r+1; // return true + `resume' returns
			}
		}
开发者ID:Jornason,项目名称:UniLua,代码行数:18,代码来源:LuaCoroLib.cs

示例3: WidgetReadOper

 protected override bool WidgetReadOper(ILuaState lua, string key)
 {
     switch (key)
     {
         case "bRecalculate":
             lua.PushBoolean(bRecalculate);
             break;
         default:
             return base.WidgetReadOper(lua, key);
     }
     return true;
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:12,代码来源:StoryCombineCtrl.cs

示例4: WidgetReadOper

 protected override bool WidgetReadOper(ILuaState lua, string key)
 {
     switch (key)
     {
         case "onFinish":
             if (m_pfnFinish != 0)
             {
                 //lua.RawGetRegistry(m_pfnFinish);
             }
             return true;
         case "bDestroyOnFinish":
             lua.PushBoolean(m_bDestroyOnFinish);
             return true;
         case "finishTime":
             lua.PushNumber(m_fEffectTime);
             return true;
     }
     return base.WidgetReadOper(lua, key);
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:19,代码来源:LuaEffect.cs

示例5: B_CollectGarbage

        public static int B_CollectGarbage( ILuaState lua )
        {
            // not implement gc
            string opt = lua.L_OptString( 1, "collect" );
            switch( opt )
            {
                case "count":
                    lua.PushNumber( 0 );
                    lua.PushNumber( 0 );
                    return 2;

                case "step":
                case "isrunning":
                    lua.PushBoolean( true );
                    return 1;

                default:
                    lua.PushInteger( 0 );
                    return 1;
            }
        }
开发者ID:matthewyang,项目名称:UniLua,代码行数:21,代码来源:LuaBaseLib.cs

示例6: getVOProperty

 /// <summary>
 /// 获取IBattleVO接口中的属性
 /// </summary>
 /// <param name="luaState"></param>
 /// <returns></returns>
 public static int getVOProperty(ILuaState luaState)
 {
     IBattleVO vo = (IBattleVO)luaState.ToUserData(-2);
     if (vo == null)
     {
         luaState.PushNil();
     }
     else
     {
         BattleConsts.Property propId = (BattleConsts.Property)luaState.ToInteger(-1);
         object prop = vo.getProperty(propId);
         if (prop == null)
         {
             luaState.PushNil();
         }
         else
         {
             // todo 暂时使用is来判断
             // 以后可能会加入全局hash
             if ( prop is int )
             {
                 luaState.PushInteger((int)prop);
             }
             else if ( prop is bool )
             {
                 luaState.PushBoolean((bool)prop);
             }
             else if ( prop is string )
             {
                 luaState.PushString((string)prop);
             }
             else
             {
                 luaState.PushLightUserData(prop);
             }
         }
     }
     return 1;
 }
开发者ID:LostTemple1990,项目名称:TouHouExploding,代码行数:44,代码来源:PropertyLib.cs

示例7: WidgetReadOper

        protected override bool WidgetReadOper(ILuaState lua, string key)
        {
            switch (key)
            {
                case "visible":
                    lua.PushBoolean(Visible);
                    return true;
                case "direction":
                    lua.PushNumber(GetDirection());
                    return true;
                case "type":
                    lua.PushInteger((int)GetEntityType());
                    return true;
                case "scale":
                    lua.PushNumber(transform.localScale.x);
                     return true;
                case "height":
                    lua.PushNumber(m_height);
                    return true;
                case "radius":
                    lua.PushNumber(m_Radius);
                    return true;
                case "highlightcolor":
                    lua.NewTable();
                     
                    lua.PushNumber(_highlightColor.r);
                    lua.SetField(-2,"r");

                    lua.PushNumber(_highlightColor.g);
                    lua.SetField(-2,"g");

                    lua.PushNumber(_highlightColor.b);
                    lua.SetField(-2,"b");

                    lua.PushNumber(_highlightColor.a);
                    lua.SetField(-2,"a");
                    return true;
            }

            return base.WidgetReadOper(lua, key);
        }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:41,代码来源:Entity.cs

示例8: pmain

 /// <summary>
 /// Main body of stand-alone interpreter (to be called in protected mode).
 /// Reads the options and handles them all.
 /// </summary>
 static int pmain(ILuaState L)
 {
     int argc = L.ToInteger(1);
     var argv = L.ToUserData<String[]>(2);
     int script = 0;
     int args = collectargs(argv, ref script);
     L.CheckVersion();   /* check that interpreter has correct version */
     if (argc > 0 && !String.IsNullOrWhiteSpace(argv[0])) progname = argv[0];
     if (args == has_error)
     {  /* bad arg? */
         print_usage(L, argv[script]);  /* 'script' has index of bad arg. */
         return 0;
     }
     if ((args & has_v) != 0)  /* option '-v'? */
         print_version(L);
     if ((args & has_E) != 0)
     {  /* option '-E'? */
         L.PushBoolean(true);  /* signal for libraries to ignore env. vars. */
         L.SetField(L.RegistryIndex, "LUA_NOENV");
     }
     //  luaL_openlibs(L);  /* open standard libraries */
     L.OpenLibs();
     createargtable(L, argv, argc, script);  /* create table 'arg' */
     if (0 == (args & has_E))
     {  /* no option '-E'? */
         if (handle_luainit(L) != LuaStatus.OK)  /* run LUA_INIT */
             return 0;  /* error running LUA_INIT */
     }
     if (runargs(L, argv, script) == 0)  /* execute arguments -e and -l */
         return 0;  /* something failed */
     if (script < argc &&  /* execute main script (if there is one) */
         handle_script(L, argv, script) != LuaStatus.OK)
         return 0;
     if ((args & has_i) != 0)  /* -i option? */
         doREPL(L);  /* do read-eval-print loop */
     else if (script == argc && 0 == (args & (has_e | has_v)))
     {  /* no arguments? */
         if (lua_stdin_is_tty())
         {  /* running in interactive mode? */
             print_version(L);
             doREPL(L);  /* do read-eval-print loop */
         }
         else dofile(L, null);  /* executes stdin as a file */
     }
     L.PushBoolean(true);  /* signal no errors */
     return 1;
 }
开发者ID:ygrenier,项目名称:LuaN,代码行数:51,代码来源:Program.cs

示例9: FinishPCall

 private static int FinishPCall( ILuaState lua, bool status )
 {
     lua.PushBoolean( status );
     lua.Replace( 1 );
     return lua.GetTop();
 }
开发者ID:matthewyang,项目名称:UniLua,代码行数:6,代码来源:LuaBaseLib.cs

示例10: B_RawEqual

 public static int B_RawEqual( ILuaState lua )
 {
     lua.L_CheckAny( 1 );
     lua.L_CheckAny( 2 );
     lua.PushBoolean( lua.RawEqual( 1, 2 ) );
     return 1;
 }
开发者ID:matthewyang,项目名称:UniLua,代码行数:7,代码来源:LuaBaseLib.cs

示例11: FinishPCall

 private static int FinishPCall( ILuaState lua, bool status )
 {
     // no space for extra boolean?
     if(!lua.CheckStack(1)) {
         lua.SetTop(0); // create space for return values
         lua.PushBoolean(false);
         lua.PushString("stack overflow");
         return 2;
     }
     lua.PushBoolean( status );
     lua.Replace( 1 );
     return lua.GetTop();
 }
开发者ID:rokyado,项目名称:UniLua,代码行数:13,代码来源:LuaBaseLib.cs

示例12: WidgetReadOper

 protected override bool WidgetReadOper(ILuaState lua, string key)
 {
     switch (key)
     {
         case "talkInfo":
             lua.PushString(_realInfo.talkInfo);
             break;
         case "talkName":
             lua.PushString(_realInfo.talkName);
             break;
         case "bHideNext":
             lua.PushBoolean(_realInfo.bHideNext);
             break;
         default:
             return base.WidgetReadOper(lua, key);
     }
     return true;
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:18,代码来源:StoryTalkCtrl.cs

示例13: WidgetReadOper

 protected override bool WidgetReadOper(ILuaState lua, string key)
 {
     switch (key)
     {
         case "musicName":
             lua.PushString(_realInfo.musicName);
             break;
         case "volume":
             lua.PushNumber(_realInfo.volume);
             break;
         case "bLoop":
             lua.PushBoolean(_realInfo.bLoop);
             break;
         default:
             return base.WidgetReadOper(lua, key);
     }
     return true;
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:18,代码来源:StoryMusicCtrl.cs

示例14: showChessboardDialog

 /// <summary>
 /// 显示棋盘对话框
 /// <para>string message</para>
 /// </summary>
 public static int showChessboardDialog(ILuaState luaState)
 {
     string message = luaState.ToString(1);
     ChessboardDialogControl.SetDialogString(message);
     luaState.PushBoolean(ChessboardDialogControl.GetClickedButton());
     return 1;
 }
开发者ID:LostTemple1990,项目名称:TouHouExploding,代码行数:11,代码来源:EffectLib.cs

示例15: WidgetReadOper

 protected override bool WidgetReadOper(ILuaState lua, string key)
 {
     switch (key)
     {
         case "speed":
             lua.PushNumber(_realInfo.speed);
             break;
         case "dwMMethod":
             lua.PushInteger(_realInfo.dwMMethod);
             break;
         case "bInitPosition":
             lua.PushBoolean(_realInfo.bInitPosition);
             break;
         case "localPosition":
             LuaExport.Vector3ToStack(lua, _realInfo.localPosition);
             break;
         case "directPos":
             LuaExport.Vector3ToStack(lua, _realInfo.directPosition);
             break;
         default:
             return base.WidgetReadOper(lua, key);
     }
     return true;
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:24,代码来源:StoryMoveCtrl.cs


注:本文中的ILuaState.PushBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。