private void OnTriggerStay2D(Collider2D collision) { SquadTriggerInitiator initiator = null; if (collision != null) { initiator = collision.GetComponent <SquadTriggerInitiator>(); } if (initiator == null && initiator.Squad == null) { return; } if (instance == null) { instance = Instantiate(original, Vector3.zero, transform.rotation) as ArrowsValley; instance.Init(initiator.transform.position, instance.damage, 9, 300); instance.StartValley(); } }
public override bool Execute(object skillStats) { bool res = base.Execute(skillStats); if (res) { ArrowWalleyStats stats; if (skillStats != null && skillStats is ArrowWalleyStats) { stats = (ArrowWalleyStats)skillStats; } else { stats = this.stats; } ArrowsValley valley = Instantiate(origin, Vector2.zero, castRotation); valley.Init(castPosition, stats.damage, stats.radius, stats.countOfArrows, owner, stats.delay); valley.StartValley(); } return(res); }