本文整理汇总了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();
}
示例2: LightingGlobal
public LightingGlobal(ScriptContext context)
: base(context)
{
flashPaletteEffects = context.World.WorldActor.TraitsImplementing<FlashPaletteEffect>();
lighting = context.World.WorldActor.TraitOrDefault<GlobalLightingPaletteEffect>();
hasLighting = lighting != null;
}
示例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);
}
示例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 });
}
示例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);
}
示例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);
}
示例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;
}
示例8: TriggerGlobal
public TriggerGlobal(ScriptContext context)
: base(context)
{
}
示例9: RegisterCallback
public void RegisterCallback(Trigger trigger, LuaFunction func, ScriptContext context)
{
Triggerables(trigger).Add(new Triggerable(func, context, self));
}
示例10: Triggerable
public Triggerable(LuaFunction function, ScriptContext context, Actor self)
{
Function = (LuaFunction)function.CopyReference();
Context = context;
Self = self.ToLuaValue(Context);
}
示例11: ReinforcementsGlobal
public ReinforcementsGlobal(ScriptContext context) : base(context) { }
示例12: OnScriptBind
public void OnScriptBind(ScriptContext context)
{
luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this));
}
示例13: PlayerProperties
public PlayerProperties(ScriptContext context, Player player)
: base(context, player)
{
}
示例14: PlayerGlobal
public PlayerGlobal(ScriptContext context) : base(context) { }
示例15: MediaGlobal
public MediaGlobal(ScriptContext context)
: base(context)
{
world = context.World;
playlist = world.WorldActor.Trait<MusicPlaylist>();
}