Beispiel #1
0
    public static List <WayPoint> GetWayPoint(LevelData level)
    {
        List <WayPoint> wayPoint = new List <WayPoint>();
        string          items    = level.sceneItems;

        if (!string.IsNullOrEmpty(items))
        {
            wayPoint = WayLoader.ReLoad(items);
        }
        return(wayPoint);
    }
Beispiel #2
0
    public void LoadWayPoint()
    {
        wayPointRoot = GameObject.Find("WayPointRoot");
        if (wayPointRoot == null)
        {
            wayPointRoot = new GameObject("WayPointRoot");
            ObjectUtils.Identity(wayPointRoot);
        }
        string          assetPath = string.Format("sn{0}", this.levelId);
        List <WayPoint> wayPoints = WayLoader.ReLoad(assetPath);

        for (int i = 0; i < wayPoints.Count; i++)
        {
            GameObject obj = new GameObject(string.Format("wayPoint{0}", i));
            ObjectUtils.Identity(obj, wayPointRoot.transform);
            obj.transform.position = wayPoints[i].pos;
            obj.AddComponent <BoxCollider>().size = new Vector3(wayPoints[i].size, wayPoints[i].size, wayPoints[i].size);
        }
    }