49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using UnityEngine;
|
|
using LuaFramework;
|
|
using BestHTTP;
|
|
using BestHTTP.WebSocket;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
public class BattleMgr
|
|
{
|
|
|
|
|
|
public static void StartBattle(JoinInfo join_info)
|
|
{
|
|
//CUILoading.OpenLoading();
|
|
//CUILoading.SetLoading(0);
|
|
Mt.Table.Load();
|
|
GameObject fightRootObject = new GameObject("fight");
|
|
{
|
|
fightRootObject.transform.parent = LuaHelper.GetGameManager().m_pGameMap.transform;
|
|
fightRootObject.layer = CUtil.WorldMapLayer_0_31;
|
|
}
|
|
GameObject mapObj = new GameObject("map");
|
|
{
|
|
mapObj.transform.parent = fightRootObject.transform;
|
|
mapObj.layer = CUtil.WorldMapLayer_0_31;
|
|
TransformExtension.localPosition(mapObj.transform, 0, 0, 0);
|
|
TransformExtension.localScale(mapObj.transform, 1, 1, 1);
|
|
}
|
|
var mapBase = LuaHelper.GetResManager().LoadPrefab<GameObject>("map16", "Data/model/mapterrain/", "model/mapterrain");
|
|
var t = CUtil.AddChild(mapObj, mapBase, true);
|
|
{
|
|
TransformExtension.localEulerAngles(t.transform, 0, 0, 0);
|
|
TransformExtension.localPosition(t.transform, 0, 0, 0);
|
|
}
|
|
{
|
|
var terrainName = "l_" + "map16";
|
|
var terrainObj = LuaHelper.GetResManager().LoadPrefab<GameObject>(
|
|
terrainName, "Data/model/mapterrain/", "model/mapterrain");
|
|
CUtil.AddChild(t, terrainObj, true);
|
|
TransformExtension.localEulerAngles(terrainObj.transform, 0, 0, 0);
|
|
TransformExtension.localPosition(terrainObj.transform, 0, 0, 0);
|
|
}
|
|
{
|
|
var b = new Battle(join_info);
|
|
}
|
|
}
|
|
|
|
}
|