protected override void InitControl(Entities.ISceneObject me) { base.InitControl(me); me.SceneMgr.BeginInvoke(new Action(() => { me.GetGeometry().Opacity = 0.5; })); }
protected override void InitControl(Entities.ISceneObject me) { this.obj = me.GetControlOfType <IHpControl>(); if (this.obj == null) { throw new Exception("HpBarControl must be attached to object containing HpControl"); } }
protected override void InitControl(Entities.ISceneObject me) { if (controlsForDisabling != null) { controlsForDisabling.ForEach(control => control.Enabled = false); } events.AddEvent(1, new Event(Time, EventType.ONE_TIME, new Action(() => { ReenableControls(); }))); }
protected override void InitControl(Entities.ISceneObject me) { if (me is Base) { baze = me as Base; } this.emmitors = new Stack <EmmitorGroup>(); this.dead = new Queue <EmmitorGroup>(); this.rand = me.SceneMgr.GetRandomGenerator(); }
protected override void InitControl(Entities.ISceneObject me) { base.InitControl(me); if (!(me is ISpheric)) { Logger.Error("ShrinkingControl can be attached only to object with Radius property!"); return; } sphere = me as ISpheric; }
protected override void InitControl(Entities.ISceneObject me) { me.SceneMgr.Invoke(new Action(() => { effect = new PinchEffect(); effect.Radius = Radius; effect.Amount = 0; effect.CenterX = Position.X / SharedDef.VIEW_PORT_SIZE.Width; effect.CenterY = Position.Y / SharedDef.VIEW_PORT_SIZE.Height; me.SceneMgr.GetCanvas().Effect = effect; })); }
public void ProccessDamage(int damage, Entities.ISceneObject causedBy) { if (causedBy is IDestroyable) { (causedBy as IDestroyable).TakeDamage(damage / 4, me); me.SceneMgr.FloatingTextMgr.AddFloatingText(damage / 4, me.Position, FloatingTextManager.TIME_LENGTH_3, FloatingTextType.DAMAGE); } if (me is MiningModule) { SendDamage(damage / 4, causedBy, me as MiningModule); } }
protected override void InitControl(Entities.ISceneObject me) { if (me is Line) { line = me as Line; } else { throw new Exception("MiningLineControl must be attached to SolidLine object"); } events.AddEvent(1, new Event(SharedDef.SPECTATOR_ORBITS_SPAWN_TIME, EventType.REPEATABLE, new Action(() => { SpawnNewEllipse(); }))); }
protected override void InitControl(Entities.ISceneObject me) { Vulnerable = true; hp = MaxHp; if (me is MiningModule) { module = me as MiningModule; } else { throw new Exception("ModuleDamageControl must be attached to MiningModule object"); } }
protected override void InitControl(Entities.ISceneObject me) { hp = MaxHp; }
protected override void InitControl(Entities.ISceneObject me) { me.GetControlsOfType <IDamageControl>().ForEach(control => control.Vulnerable = false); Vulnerable = true; }