示例#1
0
        // Use this for initialization
        void Start()
        {
            indicatorT           = pSystem.transform;
            pSystem.emissionRate = 0;

            waypointList = path.GetWaypointList();

            StartCoroutine(Move());
        }
示例#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));
        }
示例#3
0
        // Use this for initialization
        void Start()
        {
            indicatorT = pSystem.transform;
            //pSystem.emissionRate=0;

            var em = pSystem.emission;

            em.rateOverTime = 0;

            waypointList = path.GetWaypointList();

            StartCoroutine(Move());
        }
示例#4
0
        public void SetNewPath(PathTD newPath)
        {
            // TODO Path destruction is here ?
            // Paths zero ??
            if (path != null && path.name == "CreepCustomPath")
            {
                Destroy(path.gameObject);
            }

            path         = newPath;
            waypointID   = 1;
            waypointList = path.GetWaypointList();

            distFromDestination = CalculateDistFromDestination();
        }
		//parent unit is for unit which is spawned from destroyed unit
		public void Init(PathTD p, int ID, int wID){
			//for navigation using navmesh, not in use at all, require navmesh carving (unity-pro only) to work properly
			//if(useNavMesh){ InitNavMesh(p, ID, wID); return; }
			
			Init();
			
			path=p;
			instanceID=ID;
			waveID=wID;
			
			float dynamicX=Random.Range(-path.dynamicOffset, path.dynamicOffset);
			float dynamicZ=Random.Range(-path.dynamicOffset, path.dynamicOffset);
			pathDynamicOffset=new Vector3(dynamicX, 0, dynamicZ);
			thisT.position+=pathDynamicOffset;
			
			waypointID=1;
			waypointList=path.GetWaypointList();
			
			distFromDestination=CalculateDistFromDestination();
		}
示例#6
0
        //parent unit is for unit which is spawned from destroyed unit
        public void Init(PathTD p, int ID, int wID)
        {
            //for navigation using navmesh, not in use at all, require navmesh carving (unity-pro only) to work properly
            //if(useNavMesh){ InitNavMesh(p, ID, wID); return; }

            Init();

            path       = p;
            instanceID = ID;
            waveID     = wID;

            float dynamicX = Random.Range(-path.dynamicOffset, path.dynamicOffset);
            float dynamicZ = Random.Range(-path.dynamicOffset, path.dynamicOffset);

            pathDynamicOffset = new Vector3(dynamicX, 0, dynamicZ);
            thisT.position   += pathDynamicOffset;

            waypointID   = 1;
            waypointList = path.GetWaypointList();

            distFromDestination = CalculateDistFromDestination();
        }
示例#7
0
        public void SetNewPath(PathTD newPath)
        {
            // TODO Path destruction is here ?
              // Paths zero ??
              if (path != null && path.name == "CreepCustomPath")
              {
            Destroy(path.gameObject);
              }

              path = newPath;
              waypointID = 1;
              waypointList = path.GetWaypointList();

              distFromDestination = CalculateDistFromDestination();
        }