public RangeState(FiniteStateMachine fsm)
     : base(fsm)
 {
     _attack = fsm.GetComponent<KRAttack>();
     _krtransform = fsm.GetComponent<KRTransform>();
     _krmovement = fsm.GetComponent<KRMovement>();
 }
 void Awake()
 {
     _krtransform = GetComponent<KRTransform>();
     _spawnableObjects = new Dictionary<String, Object>();
     AddSpawnable("Infantry");
     AddSpawnable("Archer");
     _sweetBlue = (Material) Resources.Load("Materials/SweetBlue", typeof(Material));
     _sweetRed = (Material) Resources.Load("Materials/SweetRed", typeof(Material));
 }
Example #3
0
 void Awake()
 {
     _krtransform      = GetComponent <KRTransform>();
     _spawnableObjects = new Dictionary <String, Object>();
     AddSpawnable("Infantry");
     AddSpawnable("Archer");
     _sweetBlue = (Material)Resources.Load("Materials/SweetBlue", typeof(Material));
     _sweetRed  = (Material)Resources.Load("Materials/SweetRed", typeof(Material));
 }
 void Awake()
 {
     _krtransform = GetComponent <KRTransform>();
     Speed        = __speed;
 }
 public void Follow(KRTransform kt)
 {
     Followee = kt;
     Move(kt.Pos);
 }
 public static void Remove(KRTransform t)
 {
     _Map.Remove(t);
 }
 public static void Add(KRTransform t)
 {
     _Map.Add(t);
 }
 public void Follow(KRTransform kt)
 {
     Followee = kt;
     Move(kt.Pos);
 }
 void Awake()
 {
     _krtransform = GetComponent<KRTransform>();
     Speed = __speed;
 }
 public void Attack(GameObject go)
 {
     BeforeAttack();
     Target = go.GetComponent<KRTransform>();
     AfterAttack();
 }
 public void Attack(Vec2 modelPoint)
 {
     BeforeAttack();
     Target = KRFacade.Find(modelPoint).GetComponent<KRTransform>();
     AfterAttack();
 }
 void OnTargetDeath(GameObject go)
 {
     Target = null;
 }