internal override void DoStart() { RegisterInheridedOrderStateOptions(typeof(OPTIONS)); movement = this.GetComponent <Movability>(); this.gameObject.GetComponent <Pilot>().mySpace = this.gameObject.GetComponent <SphereCollider>(); GetComponent <Pilot>().Controlls = movement; // GetComponent<SphereCollider>().isTrigger = true; //movement.WayPoints.Add(new Vector3(120, 0, 25)); //movement.WayPoints.Add(new Vector3(70, 0, -25)); }
internal override void DoStart() { RegisterInheridedOrderStateOptions(typeof(OPTIONS)); movement = this.GetComponent<Movability>(); this.gameObject.GetComponent<Pilot>().mySpace = this.gameObject.GetComponent<SphereCollider>(); GetComponent<Pilot>().Controlls = movement; // GetComponent<SphereCollider>().isTrigger = true; //movement.WayPoints.Add(new Vector3(120, 0, 25)); //movement.WayPoints.Add(new Vector3(70, 0, -25)); }
public void Move_UpdatesTheLocationOfTheUnitAccordingly(IUnit<Archer> unit, ITile destination) { // :::: ARRANGE :::: var movableUnit = new Movability<Archer>(unit); // :::: ACT :::: movableUnit.MoveTo(destination); // :::: ASSERT :::: unit.Location.Should().Be(destination); }
/* Start & Awake & Update */ void Awake() { Controlls = this.gameObject.GetComponent <Movability>(); My = gameObject.GetComponent <UnitScript>(); if (!mySpace) { if ((!this.gameObject.GetComponent <SphereCollider>()) && (!this.gameObject.GetComponentInChildren <SphereCollider>())) { this.gameObject.AddComponent <SphereCollider>().isTrigger = true; } } }
private bool Attack() { if (GetComponent <Gunner>()) { GetComponent <Gunner>().DoUpdate(); } if (UNIT.Options.Target) { AttackPoint = UNIT.Options.Target.transform.position; if (!UNIT.IsABuilding) { Movability Movement = GetComponent <Movability>(); Movement.IsMoving = true; Movement.MovingDirection = UNIT.Options.MoveToPoint; if (Movement.Distance < UNIT.AttackRange) { UNIT.weapon.Reload(); UNIT.weapon.Engage(UNIT.Options.Target); } return(UNIT.Options.Target); } else { if (Vector3.Distance(this.gameObject.transform.position, AttackPoint) <= UNIT.AttackRange) { UNIT.weapon.Reload(); UNIT.weapon.Engage(UNIT.Options.Target); } } return((bool)UNIT.Options.Target); } else { return(false); } }
/* Start & Awake & Update */ void Awake() { Controlls = this.gameObject.GetComponent<Movability>(); My = gameObject.GetComponent<UnitScript>(); if (!mySpace) if ((!this.gameObject.GetComponent<SphereCollider>())&&(!this.gameObject.GetComponentInChildren<SphereCollider>())) this.gameObject.AddComponent<SphereCollider>().isTrigger = true; }