本文整理汇总了C#中EntityEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# EntityEventArgs类的具体用法?C# EntityEventArgs怎么用?C# EntityEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityEventArgs类属于命名空间,在下文中一共展示了EntityEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onCreate
private static void onCreate(EntityEventArgs args)
{
var ent = args.Entity;
if (!(ent is Projectile))
return;
//Projectile proj = ent as Projectile;
}
示例2: EntityRemoved
private void EntityRemoved(object sender, EntityEventArgs entityEventArgs)
{
var gameObj = entityEventArgs.Entity;
if (gameObj.GetComponent<Collider>() == null) return;
var collider = gameObj.GetComponent<Collider>();
colliders.Remove(collider);
grid.RemoveCollider(collider);
}
示例3: OnAddEntity
public void OnAddEntity(EntityEventArgs args)
{
var unit = args.Entity as Unit;
if (unit == null || !unit.IsValid || !unit.IsControllable || unit.Team != heroTeam
|| (unit.IsIllusion && unit.ClassID != hero.ClassID) || unit.AttackCapability == AttackCapability.None
|| ignoredUnits.Contains(unit.ClassID) || unit.Equals(hero))
{
return;
}
var contrallable = new Controllable(unit);
contrallable.OnCampChange += OnCampChange;
controllableUnits.Add(contrallable);
}
示例4: OnAddEntity
public void OnAddEntity(EntityEventArgs args)
{
DelayAction.Add(
1000f,
() =>
{
var unit = args.Entity as Creep;
if (unit == null || !unit.IsValid || unit.Team == heroTeam)
{
return;
}
killableList.Add(new Classes.Creep(unit));
});
}
示例5: graphVisualization_OnEntityAdded
private void graphVisualization_OnEntityAdded(object sender, EntityEventArgs e) {
IConnection connection = e.Entity as IConnection;
if (connection != null && !this.connectionInfoConnectionMapping.ContainsSecond(connection)) {
IConnector connectorFrom = connection.From.AttachedTo;
IConnector connectorTo = connection.To.AttachedTo;
this.RemoveConnection(connection); //is added again by the model events
if (connectorFrom != null && connectorTo != null) {
IShape shapeFrom = (IShape)connectorFrom.Parent;
IShape shapeTo = (IShape)connectorTo.Parent;
IShapeInfo shapeInfoFrom = this.shapeInfoShapeMapping.GetBySecond(shapeFrom);
IShapeInfo shapeInfoTo = this.shapeInfoShapeMapping.GetBySecond(shapeTo);
string connectorFromName = connectorFrom.Name;
string connectorToName = connectorTo.Name;
if (shapeInfoFrom != shapeInfoTo) //avoid self references
this.Content.AddConnectionInfo(new ConnectionInfo(shapeInfoFrom, connectorFromName, shapeInfoTo, connectorToName));
}
}
}
示例6: ObjectManager_OnRemoveEntity
private void ObjectManager_OnRemoveEntity(EntityEventArgs args)
{
predictions.OnRemoveEntity(args);
}
示例7: shape_OnEntityChange
private void shape_OnEntityChange(object sender, EntityEventArgs e) {
IShape shape = e.Entity as IShape;
IShapeInfo shapeInfo = this.shapeInfoShapeMapping.GetBySecond(shape);
this.DeregisterShapeInfoEvents(shapeInfo);
shapeInfo.UpdateShapeInfo(shape);
this.RegisterShapeInfoEvents(shapeInfo);
this.graphVisualization.Invalidate();
}
示例8: ObjectMgr_OnAddEntity
private static void ObjectMgr_OnAddEntity(EntityEventArgs args)
{
if (me == null || !Game.IsInGame)
{
return;
}
var ent = args.Entity as Unit;
if (ent == null)
{
return;
}
//if (ent is Hero && !ent.IsIllusion && ent.Team == me.GetEnemyTeam())
//{
// Console.WriteLine("Heroadded");
// enemyHeroes =
// ObjectMgr.GetEntities<Hero>()
// .Where(x => x != null && x.IsValid && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
//}
if ((ent.ClassID == ClassID.CDOTA_NPC_TechiesMines) && !remoteMinesDb.ContainsKey(ent))
{
remoteMinesDb.Add(ent, remoteMinesDmg);
}
}
示例9: ObjectMgr_OnRemoveEntity
/// <summary>
/// The object manager on remove entity.
/// </summary>
/// <param name="args">
/// The args.
/// </param>
private static void ObjectMgr_OnRemoveEntity(EntityEventArgs args)
{
var tower = args.Entity as Building;
if (tower == null)
{
return;
}
All.Remove(tower);
if (tower.Team == Team.Dire)
{
Dire.Remove(tower);
}
else
{
Radiant.Remove(tower);
}
}
示例10: HandleTaskUpdated
void HandleTaskUpdated(object sender, EntityEventArgs<Task> e)
{
ITaskListItemViewModel item = Items.FirstOrDefault(i => i.Id == e.Entity.Id);
if (item != null)
{
Task task = tasksModel.Get(e.Entity.Id);
item.Update(task);
}
ItemsView.Refresh();
}
示例11: mDefaultPage_OnEntityAdded
void mDefaultPage_OnEntityAdded(object sender, EntityEventArgs e)
{
//don't add it if it's already there or if it's a group (unless you want to deploy something special to emphasize a group shape).
if (!mPaintables.Contains(e.Entity) && !(e.Entity is IGroup))
{
//set the new entity on top of the stack
e.Entity.SceneIndex = mPaintables.Count;
mPaintables.Add(e.Entity);
}
RaiseOnEntityAdded(e);
}
示例12: OnEntityRemoved
protected virtual void OnEntityRemoved(EntityEventArgs e)
{
if (EntityRemoved != null)
EntityRemoved(this, e);
OnModified(EventArgs.Empty);
}
示例13: Model_OnEntityAdded
void Model_OnEntityAdded(object sender, EntityEventArgs e)
{
}
示例14: RaiseOnSelect
// ------------------------------------------------------------------
/// <summary>
/// Raises the OnSelect event.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The
/// <see cref="T:Netron.Diagramming.Core.EntityEventArgs"/> instance
/// containing the event data.</param>
// ------------------------------------------------------------------
protected virtual void RaiseOnSelect(
object sender,
EntityEventArgs e) {
if (OnEntitySelect != null) {
OnEntitySelect(sender, e);
}
}
示例15: graphVisualization_OnEntityRemoved
private void graphVisualization_OnEntityRemoved(object sender, EntityEventArgs e) {
IShape shape = e.Entity as IShape;
if (shape != null && this.shapeInfoShapeMapping.ContainsSecond(shape)) {
IShapeInfo shapeInfo = this.shapeInfoShapeMapping.GetBySecond(shape);
this.Content.RemoveShapeInfo(shapeInfo);
}
IConnection connection = e.Entity as IConnection;
if (connection != null && this.connectionInfoConnectionMapping.ContainsSecond(connection)) {
IConnectionInfo connectionInfo = connectionInfoConnectionMapping.GetBySecond(connection);
this.Content.RemoveConnectionInfo(connectionInfo);
}
}