public override void Attack(Entity target) { if (target != this) { base.Attack(target); PhotonUtils.Instantiate(this.projectile, this.transform.TransformPoint(this.launchLocation)).Target = target; } }
private void Update() { //Check if building, if so check for completion of current unit if (this.Mine && this.IsBuilding && this.buildTimer.Elapsed.TotalSeconds >= this.inProgress.BuildTime) { //Get unit and spawn it Unit unit = this.buildQueue.First.Value; Unit clone = PhotonUtils.Instantiate(unit, this.spawnLocation.position, unit.transform.rotation, this.transform.parent); clone.MoveUnit(clone.Position + this.transform.forward * 2f, clone.Position); GameEvents.OnUnitCreated.Invoke(clone); //Pop build queue PopQueue(); } }