當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。