Exemplo n.º 1
0
        void ReachDestination()
        {
            Debug.Log("ReachDestination");

            GameControl.OnCreepReachDestination(this);
            SpawnManager.OnCreepReachDestination(this);
            TDTK.OnCreepDestination(this);

            if (path.loop)
            {
                if (!path.IsLinearPath())
                {
                    //if(onDestinationE!=null) onDestinationE(this);
                    subWaypointID = 0;
                    waypointID    = path.GetLoopPoint();
                    subPath       = path.GetWPSectionPath(waypointID);
                }
                else
                {
                    waypointID = path.GetLoopPoint();
                }
                return;
            }

            destroyed = true;

            //if(onDestinationE!=null) onDestinationE(this);

            //float delay=0;
            //if(aniInstance!=null){ delay=aniInstance.PlayDestination(); }

            StartCoroutine(_ReachDestination(PlayAnimDestination()));
        }
Exemplo n.º 2
0
        void ReachDestination()
        {
            if (path.loop)
            {
                if (onDestinationE != null)
                {
                    onDestinationE(this);
                }
                waypointID   = path.GetLoopPoint();
                waypointList = path.GetWaypointList();
                return;
            }

            dead = true;

            if (onDestinationE != null)
            {
                onDestinationE(this);
            }

            float delay = 0;

            if (aniInstance != null)
            {
                delay = aniInstance.PlayDestination();
            }

            StartCoroutine(_ReachDestination(delay));
        }
Exemplo n.º 3
0
 void ReachDestination()
 {
     if (path.loop)
     {
         if (onDestinationE != null)
         {
             onDestinationE(this);
         }
         subWaypointID = 0;
         waypointID    = path.GetLoopPoint();
         subPath       = path.GetWPSectionPath(waypointID);
     }
     else
     {
         dead = true;
         if (onDestinationE != null)
         {
             onDestinationE(this);
         }
         float delay = 0;
         if (animCreep != null)
         {
             delay = animCreep.PlayDestination();
         }
         StartCoroutine(_ReachDestination(delay));
     }
 }
Exemplo n.º 4
0
        void ReachDestination()
        {
            //Debug.Log("ReachDestination");

            if (destinationEffObj != null)
            {
                if (!autoDestroydestinationEff)
                {
                    ObjectPoolManager.Spawn(destinationEffObj, thisT.position, thisT.rotation);
                }
                else
                {
                    ObjectPoolManager.Spawn(destinationEffObj, thisT.position, thisT.rotation, destinationEffDuration);
                }
            }

            GameControl.OnCreepReachDestination(this);
            SpawnManager.OnCreepReachDestination(this);
            TDTK.OnCreepDestination(this);

            if (path.loop)
            {
                if (!path.IsLinearPath())
                {
                    //if(onDestinationE!=null) onDestinationE(this);
                    subWaypointID = 0;
                    waypointID    = path.GetLoopPoint();
                    SetSubPath(path.GetWPSectionPath(waypointID));
                }
                else
                {
                    waypointID = path.GetLoopPoint();
                }
                return;
            }

            destroyed = true;

            //if(onDestinationE!=null) onDestinationE(this);

            //float delay=0;
            //if(aniInstance!=null){ delay=aniInstance.PlayDestination(); }

            StartCoroutine(_ReachDestination(PlayAnimDestination()));
        }
Exemplo n.º 5
0
 //flag passed indicate initial reset, only true in the first call
 void Reset(bool initial = false)
 {
     //if use path-looping, use loop point otherwise use the starting point
     if (path.loop && !initial)
     {
         waypointID = path.GetLoopPoint();
     }
     else
     {
         waypointID = 1;
     }
     subWaypointID = 0;
     subPath       = path.GetWPSectionPath(waypointID);
     //only reset position if not using path-looping or it's the initial reset
     if (!path.loop || initial)
     {
         indicatorT.position = path.GetSpawnPoint().position;
     }
 }