本文整理匯總了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>();
}