Ejemplo 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()));
        }
Ejemplo n.º 2
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()));
        }