예제 #1
0
파일: LoadBsp.cs 프로젝트: leNicDev/UMod
 private void Awake()
 {
     if (!string.IsNullOrEmpty(MapDirectory))
     {
         Options.FilePath = Path.Combine(MapDirectory, Options.FilePath);
     }
     var bspRoot = new BspToUnity(Options).Generate();
 }
예제 #2
0
    private void Start()
    {
        if (!string.IsNullOrEmpty(MapDirectory))
        {
            Options.FilePath = Path.Combine(MapDirectory, Options.FilePath);
        }
        var bspRoot = new BspToUnity(Options).Generate();

        bspRoot.transform.SetParent(transform, true);

        var spawns = GameObject.FindObjectsOfType <BspInfoPlayerStart>();

        if (spawns.Length > 0)
        {
            var randomSpawn = spawns[Random.Range(0, spawns.Length)];
            var movement    = GameObject.FindObjectOfType <Movement>();
            movement.Origin = randomSpawn.transform.position;
            movement.Angles = randomSpawn.transform.eulerAngles;
        }
    }