public override void Awake() { base.Awake (); Debug.Log ("Drawer::Awake()"); mBAttackState = new BuildingAttackState (this); mBIdleState = new BuildingIdleState (this); }
public void SetTarget(GameObject target, Vector2 targetPosition) { AITargetObject targetObject = new AITargetObject(target, targetPosition); BuildingAttackState attackState = new BuildingAttackState(this, targetObject, this.m_AttackBehavior); this.ChangeState(attackState); }
public override void Awake() { base.Awake(); Debug.Log("Drawer::Awake()"); mBAttackState = new BuildingAttackState(this); mBIdleState = new BuildingIdleState(this); }
private void FindTarget() { List <GameObject> actorsInScope = this.BuildingAI.SceneHelper.GetActors(this.m_AttackScopeList, this.BuildingAI.AttackBehavior.TargetType); Vector3 anchorPosition = this.BuildingAI.Property.AnchorTransform.position; foreach (GameObject actor in actorsInScope) { Vector2 delta = (Vector2)(actor.transform.position - anchorPosition); float vectorMag = Vector2.SqrMagnitude(delta); if (vectorMag <= this.BuildingAI.AttackBehavior.AttackScopeSqr) { RingAttackBehavior ringBehavior = this.BuildingAI.AttackBehavior as RingAttackBehavior; if (ringBehavior != null) { if (vectorMag <= ringBehavior.BlindScopeSqr) { continue; } } BuildingAttackState attackState = new BuildingAttackState(this.m_AIBehavior, new AITargetObject(actor, (Vector2)actor.transform.position), this.BuildingAI.AttackBehavior); this.m_AIBehavior.ChangeState(attackState); return; } } }
public override void Awake() { base.Awake (); mBAttackState = new BuildingAttackState (this); mBIdleState = new BuildingIdleState (this); mBBuildingState = new BuildingBuildState (this); mName = "Drawer" + GetInstanceID(); //Debug.Log("mName = " + mName); }
public override void Awake() { base.Awake(); Debug.Log("House::Awake()"); mSpawnPoint = gameObject.transform.Find("BulletSpawnPoint").gameObject.transform.position; mHouseBulletScript = GetComponent <Bullet> (); mBAttackState = new BuildingAttackState(this); mBIdleState = new BuildingIdleState(this); }
public override void Awake() { base.Awake (); mBAttackState = new BuildingAttackState (this); mBIdleState = new BuildingIdleState (this); mBBuildingState = new BuildingBuildState (this); mInformRangeCollider = gameObject.transform.Find ("InformRangeCollider").gameObject; mInformRange = mInformRangeCollider.GetComponent<InformRange>(); mName = "Wall" + GetInstanceID(); //Debug.Log("mName = " + mName); }
public override void Awake() { base.Awake(); Debug.Log("House::Awake()"); mSpawnPoint = gameObject.transform.Find("BulletSpawnPoint").gameObject.transform.position; mHouseBulletScript = GetComponent <Bullet> (); mBAttackState = new BuildingAttackState(this); mBIdleState = new BuildingIdleState(this); mAttackRangeCollider = gameObject.transform.Find("AttackRangeCollider").gameObject; mAttackRangeCollider.GetComponent <SphereCollider> ().radius = mAttackDistance / gameObject.transform.lossyScale.x; mAttackRange = mAttackRangeCollider.GetComponent <BuildingAttackRange> (); }
public override void Awake() { base.Awake (); Debug.Log ("House::Awake()"); mSpawnPoint = gameObject.transform.Find ("BulletSpawnPoint").gameObject.transform.position; mHouseBulletScript = GetComponent<Bullet> (); mBAttackState = new BuildingAttackState (this); mBIdleState = new BuildingIdleState (this); mAttackRangeCollider = gameObject.transform.Find ("AttackRangeCollider").gameObject; mAttackRangeCollider.GetComponent<SphereCollider> ().radius = mAttackDistance / gameObject.transform.lossyScale.x; mAttackRange = mAttackRangeCollider.GetComponent<BuildingAttackRange> (); }
public override void Awake() { base.Awake (); Debug.Log ("House::Awake()"); mSpawnPoint = gameObject.transform.Find ("BulletSpawnPoint").gameObject.transform.position; mHouseBulletScript = GetComponent<Bullet> (); mBAttackState = new BuildingAttackState (this); mBIdleState = new BuildingIdleState (this); }