// Use this for initialization void Start() { indicatorT = pSystem.transform; pSystem.emissionRate = 0; waypointList = path.GetWaypointList(); StartCoroutine(Move()); }
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)); }
// Use this for initialization void Start() { indicatorT = pSystem.transform; //pSystem.emissionRate=0; var em = pSystem.emission; em.rateOverTime = 0; waypointList = path.GetWaypointList(); StartCoroutine(Move()); }
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(); }
//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(); }