protected virtual void Awake() { Entity = GetComponent <Entity>(); Controller = Dependancy.Get <AIController>(gameObject); Controller.Init(this); }
public override void Configure(Base data) { base.Configure(data); Turret = Dependancy.Get <BaseTowerSlotTurret>(gameObject); Turret.Set(this); }
protected override void Process() { var instance = Instantiate(prefab, transform.position, transform.rotation); instance.transform.SetParent(Projectile.transform.parent); var damage = Dependancy.Get <ProjectileDamage>(Projectile.gameObject); if (damage != null) { var colliders = Physics2D.OverlapCircleAll(transform.position, radius); for (int i = 0; i < colliders.Length; i++) { var target = colliders[i].GetComponent <Entity>(); if (target == null) { continue; } if (target.gameObject.layer == gameObject.layer) { continue; } Projectile.DoDamage(damage.Value, Damage.Method.Effect, target); } } }
protected virtual void Awake() { Map = Dependancy.Get <WorldMapUI>(gameObject); Region = Dependancy.Get <RegionUI>(gameObject); Modules.Configure(this); }
protected virtual void InvokeEditorStateUpdate(float oldValue, float newValue) { foreach (var item in Dependancy.GetAll <IEditorStateUpdate>(gameObject)) { item.EDITOR_UpdateState(oldValue, newValue); } }
Projectile Create() { var instance = Instantiate(prefab, point.position, point.rotation); instance.name = "(" + Unit.name + ") " + prefab.name; var projectile = instance.GetComponent <Projectile>(); projectile.Configure(Unit); projectile.AmmendLayer(Unit.Leader.Layer); projectile.SetVelocity(velocity); projectile.OnHit += (Collider2D collider) => OnProjectileHit(projectile, collider); var travelDistance = Dependancy.Get <ProjectileTravelDistance>(projectile.gameObject); if (travelDistance != null) { travelDistance.Range = Attack.Distance * 2f; } if (Template.Attack.Penetrate) { var penetration = Dependancy.Get <ProjectilePenetration>(projectile.gameObject); if (penetration != null) { penetration.Value = Attack.Range.Value - 1 - Unit.Index; } } return(projectile); }
public override void Configure(PlayerProponent data) { base.Configure(data); Units = Dependancy.Get <ProponentUnitsUI>(gameObject); Modules.Configure(this); }
public override void Configure(ProponentAbilities reference) { base.Configure(reference); Cooldown = Dependancy.Get <ProponentAbilityCooldown>(gameObject); Modules.Configure(this); }
void Awake() { List = Dependancy.Get <AbilitiesListUI>(gameObject); Selection = Dependancy.Get <AbilitySelectionUI>(gameObject); Modules.Configure(this); }
protected override void Start() { base.Start(); var weapon = Dependancy.Get <Weapon>(gameObject, Dependancy.Scope.RecursiveToParents); weapon.OnAction += OnAction; }
protected override void Start() { base.Start(); var entity = Dependancy.Get <Entity>(gameObject, Dependancy.Scope.RecursiveToParents); entity.OnDeath += OnDeath; }
public override void Configure(UnitsUI data) { base.Configure(data); List = Dependancy.Get <UnitSelectionListUI>(gameObject); Drag = Dependancy.Get <UnitSelectionDragUI>(gameObject); }
public override void Configure(AbilitiesUI data) { base.Configure(data); List = Dependancy.Get <AbilitiesSelectionListUI>(gameObject); Drag = Dependancy.Get <AbilitySelectionDragUI>(gameObject); }
public override void Configure(Base data) { base.Configure(data); List = new List <Unit>(); Creator = Dependancy.Get <BaseUnitsCreator>(gameObject); }
public override void Configure(Unit reference) { base.Configure(reference); Component = Dependancy.Get <AudioSource>(gameObject); SFX = Dependancy.Get <SFXPlayer>(gameObject); }
public override void Configure(Proponent reference) { base.Configure(reference); Elements = new List <ProponentAbility>(); Selection = Dependancy.Get <ProponentAbilitiesSelection>(gameObject); }
protected virtual void Reset() { source = Dependancy.Get <Selectable>(gameObject, Dependancy.Scope.RecursiveToParents); Graphic = GetComponent <Graphic>(); on = off = (Graphic == null ? Color.white : Graphic.color); }
public static void Set(Transform transform, string layer) { var renderes = Dependancy.GetAll <Renderer>(transform.gameObject); for (int i = 0; i < renderes.Count; i++) { renderes[i].sortingLayerName = layer; } }
private void Awake() { Google = Dependancy.Get <GoogleLogin>(gameObject); Email = Dependancy.Get <EmailLogin>(gameObject); Guest = Dependancy.Get <GuestLogin>(gameObject); Offline = Dependancy.Get <OfflineLogin>(gameObject); Modules.Configure(this); }
public virtual void Configure(Proponent leader, IUnitSelectionData data) { this.Leader = leader; this.Template = data.Template; Upgrades = Dependancy.Get <UnitUpgrades>(gameObject); Upgrades.Set(data.Upgrades); }
public override void Execute() { if (audioSource == null) { throw Dependancy.FormatException(nameof(audioSource), this); } StartCoroutine(Procedure()); }
protected virtual void UpdateModules(float value) { var dependancies = Dependancy.GetAll <Module>(gameObject); foreach (var dependancy in dependancies) { dependancy.OnValueChanged(value); } }
protected virtual void Awake() { Health = Dependancy.Get <Health>(gameObject); Defense = Dependancy.Get <EntityDefense>(gameObject); StatusEffects = Dependancy.Get <EntityStatusEffects>(gameObject); TimeScale = Dependancy.Get <EntityTimeScale>(gameObject); Modules.Configure(this); }
public override void Execute() { if (target == null) { throw Dependancy.FormatException(nameof(target), this); } target.Hide(); }
public virtual void Configure(BaseTowerSlots slots) { this.slots = slots; Buy = Dependancy.Get <BaseTowerSlotBuyContextUI>(gameObject); Use = Dependancy.Get <BaseTowerSlotsUseContextUI>(gameObject); Sell = Dependancy.Get <BaseTowerSlotBuyContextUI>(gameObject); Modules.Configure(this); }
void Start() { label = GetComponent <Text>(); entity = Dependancy.Get <Entity>(gameObject, Dependancy.Scope.RecursiveToParents); entity.OnHealthChange += OnChange; UpdateState(); }
public virtual void Configure(Proponent data) { Proponent = data; Units = Dependancy.Get <BaseUnits>(gameObject); Tower = Dependancy.Get <BaseTower>(gameObject); Graphic = Dependancy.Get <BaseGraphic>(gameObject); Modules.Configure(this); }
protected virtual void Awake() { Entity = GetComponent <Entity>(); Input = Dependancy.Get <PlayerInput>(gameObject); Navigator = Dependancy.Get <PlayerNavigator>(gameObject); weapon.Init(Entity); }
void Awake() { List = Dependancy.Get <UnitsListUI>(gameObject); Context = Dependancy.Get <UnitContextUI>(gameObject); Selection = Dependancy.Get <UnitSelectionUI>(gameObject); Modules.Configure(this); }
public override void Configure(WorldUI data) { base.Configure(data); Levels = Dependancy.Get <LevelsUIList>(gameObject); Difficulty = Dependancy.Get <RegionDifficultyContextUI>(gameObject); Selection = new WorldCore.SelectionData(); Modules.Configure(this); }