Esempio n. 1
0
 public void OnDestroyableDie(obj.IDestroyable destroyable)
 {
     if (Target == destroyable)
     {
         Target = null;
         SetState(State.Idle);
     }
 }
Esempio n. 2
0
            void Update()
            {
                transform.position += (TargetPos - transform.position).normalized * InstanceClone.Speed * Time.deltaTime;

                obj.IDestroyable destroyable = Context.Battle.FindNearestDestroyable(transform.position, Side == Types.Side.Player ? Types.Side.Enemy : Types.Side.Player);

                if (destroyable != null && Mathf.Abs(destroyable.Position.x - transform.position.x) < 0.1f && !HitDestroyables.Contains(destroyable))
                {
                    HitDestroyables.Add(destroyable);

                    destroyable.OnHit(InstanceClone.Attack);
                }

                if ((transform.position - TargetPos).sqrMagnitude < 0.2f * 0.2f)
                {
                    Destroy(gameObject);
                }
            }
Esempio n. 3
0
 public void OnDestroyableDie(obj.IDestroyable destroyable)
 {
 }