Ejemplo n.º 1
0
            public static void MoveTo(this PeEntity entity, Vector3 dst)
            {
                Motion_Move mm = entity.GetCmpt <Motion_Move>();

                if (mm == null)
                {
                    return;
                }

                mm.MoveTo(dst);
            }
Ejemplo n.º 2
0
            public static void MoveTo(this PeEntity entity, Vector3 dest, float stopDistance, float speed)
            {
                Motion_Move mm = entity.GetCmpt <Motion_Move>();

                if (mm == null)
                {
                    return;
                }

                mm.SetSpeed(speed);
                mm.MoveTo(dest);
            }
Ejemplo n.º 3
0
 public void MoveToPosition(Vector3 pos, SpeedState speed = SpeedState.Walk)
 {
     foreach (PeEntity skEntity in m_Entities)
     {
         if (skEntity != null && !skEntity.IsDeath())
         {
             Motion_Move mover = skEntity.GetComponent <Motion_Move>();
             if (mover != null && Leader != null)
             {
                 PeTrans tr1 = mover.GetComponent <PeTrans>();
                 PeTrans tr2 = Leader.GetComponent <PeTrans>();
                 if (tr1 != null && tr2 != null)
                 {
                     float r = 3 * Random.value * Mathf.Max(1.0f, Mathf.Max(tr1.radius, tr2.radius));
                     mover.MoveTo(pos + (tr1.position - tr2.position).normalized * r, speed);
                 }
             }
         }
     }
 }