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


C# Scripting.ScriptContext类代码示例

本文整理汇总了C#中OpenRA.Scripting.ScriptContext的典型用法代码示例。如果您正苦于以下问题:C# ScriptContext类的具体用法?C# ScriptContext怎么用?C# ScriptContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ScriptActorInterface

        public ScriptActorInterface(ScriptContext context, Actor actor)
            : base(context)
        {
            this.actor = actor;

            InitializeBindings();
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:7,代码来源:ScriptActorInterface.cs

示例2: LightingGlobal

 public LightingGlobal(ScriptContext context)
     : base(context)
 {
     flashPaletteEffects = context.World.WorldActor.TraitsImplementing<FlashPaletteEffect>();
     lighting = context.World.WorldActor.TraitOrDefault<GlobalLightingPaletteEffect>();
     hasLighting = lighting != null;
 }
开发者ID:Flamewh33l,项目名称:OpenRA,代码行数:7,代码来源:LightingGlobal.cs

示例3: MapGlobal

		public MapGlobal(ScriptContext context) : base(context)
		{
			sma = context.World.WorldActor.Trait<SpawnMapActors>();

			// Register map actors as globals (yuck!)
			foreach (var kv in sma.Actors)
				context.RegisterMapActor(kv.Key, kv.Value);
		}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:8,代码来源:MapGlobal.cs

示例4: ScriptGlobal

		public ScriptGlobal(ScriptContext context)
			: base(context)
		{
			// The 'this.' resolves the actual (subclass) type
			var type = this.GetType();
			var names = type.GetCustomAttributes<ScriptGlobalAttribute>(true);
			if (names.Count() != 1)
				throw new InvalidOperationException("[LuaGlobal] attribute not found for global table '{0}'".F(type));

			Name = names.First().Name;
			Bind(new[] { this });
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:12,代码来源:ScriptContext.cs

示例5: ScriptPlayerInterface

        public ScriptPlayerInterface(ScriptContext context, Player player)
            : base(context)
        {
            this.player = player;

            var args = new object[] { context, player };
            var objects = context.PlayerCommands.Select(cg =>
            {
                var groupCtor = cg.GetConstructor(new Type[] { typeof(ScriptContext), typeof(Player) });
                return groupCtor.Invoke(args);
            });

            Bind(objects);
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:14,代码来源:ScriptPlayerInterface.cs

示例6: ScriptActorInterface

		public ScriptActorInterface(ScriptContext context, Actor actor)
			: base(context)
		{
			this.actor = actor;

			var args = new [] { actor };
			var objects = context.ActorCommands[actor.Info].Select(cg =>
			{
				var groupCtor = cg.GetConstructor(new Type[] { typeof(Actor) });
				return groupCtor.Invoke(args);
			});

			Bind(objects);
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:14,代码来源:ScriptActorInterface.cs

示例7: ScriptMemberWrapper

		public ScriptMemberWrapper(ScriptContext context, object target, MemberInfo mi)
		{
			this.context = context;
			Target = target;
			Member = mi;

			var property = mi as PropertyInfo;
			if (property != null)
			{
				IsGetProperty = property.GetGetMethod() != null;
				IsSetProperty = property.GetSetMethod() != null;
			}
			else
				IsMethod = true;
		}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:15,代码来源:ScriptMemberWrapper.cs

示例8: TriggerGlobal

 public TriggerGlobal(ScriptContext context)
     : base(context)
 {
 }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:4,代码来源:TriggerGlobal.cs

示例9: RegisterCallback

		public void RegisterCallback(Trigger trigger, LuaFunction func, ScriptContext context)
		{
			Triggerables(trigger).Add(new Triggerable(func, context, self));
		}
开发者ID:OpenRA,项目名称:OpenRA,代码行数:4,代码来源:ScriptTriggers.cs

示例10: Triggerable

			public Triggerable(LuaFunction function, ScriptContext context, Actor self)
			{
				Function = (LuaFunction)function.CopyReference();
				Context = context;
				Self = self.ToLuaValue(Context);
			}
开发者ID:OpenRA,项目名称:OpenRA,代码行数:6,代码来源:ScriptTriggers.cs

示例11: ReinforcementsGlobal

		public ReinforcementsGlobal(ScriptContext context) : base(context) { }
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:1,代码来源:ReinforcementsGlobal.cs

示例12: OnScriptBind

		public void OnScriptBind(ScriptContext context)
		{
			luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this));
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:4,代码来源:Player.cs

示例13: PlayerProperties

 public PlayerProperties(ScriptContext context, Player player)
     : base(context, player)
 {
 }
开发者ID:rhamilton1415,项目名称:OpenRA,代码行数:4,代码来源:PlayerProperties.cs

示例14: PlayerGlobal

		public PlayerGlobal(ScriptContext context) : base(context) { }
开发者ID:JackKucan,项目名称:OpenRA,代码行数:1,代码来源:PlayerGlobal.cs

示例15: MediaGlobal

 public MediaGlobal(ScriptContext context)
     : base(context)
 {
     world = context.World;
     playlist = world.WorldActor.Trait<MusicPlaylist>();
 }
开发者ID:zombie-einstein,项目名称:OpenRA,代码行数:6,代码来源:MediaGlobal.cs


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