Пример #1
0
    void Awake()
    {
        StartPoint = GameObject.FindGameObjectWithTag("Manager").GetComponent <Manager>().StartingPoint;
        EndPoint   = GameObject.FindGameObjectWithTag("Manager").GetComponent <Manager>().EndPoint;

        //CreateGhostObject(GhostPoint, 0);
        //CreateGhostObject(GhostTower, 1);
        //GhostPoint.SetActive(false);
        GhostTower.SetActive(false);

        //initialize Start and End point in TravelPoints (default, temporary)
        Point Starting = new Point(StartPoint, StartPoint.transform.position);
        Point Ending   = new Point(EndPoint, EndPoint.transform.position);

        TravelPoints.Add(Starting);
        TravelPoints.Add(Ending);

        //initialized the path heading from the start point to the end point.
        Pathway InitPathway = new Pathway(RealPathway);

        TravelRoads.Add(InitPathway);
        InitPathway.CreateOrientationForPathway(StartPoint.transform.position, EndPoint.transform.position);
    }