PVP
parent
e3a9d661a2
commit
9f8542905e
|
|
@ -1 +1 @@
|
|||
using System.Collections.Generic;
using System.ComponentModel;
using Gameplay;
using Gameplay.Area;
using Gameplay.Character;
using Gameplay.Level;
using Gameplay.SubSystems;
using UnityEngine;
public partial class SROptions
{
[Category("Level")]
public int LevelId
{
get { return _levelId; }
set { _levelId = value; }
}
private int _levelId = 101;
[Category("Level")]
public void EnterLevel()
{
LevelManager.Instance.TryEnterLevel(LevelId);
}
[Category("Level")]
public bool ShowCharacterID
{
get { return _showCharacterID; }
set
{
_showCharacterID = value;
if (_showCharacterID)
{
UIManager.Instance.OpenWindow(UINameConst.UIDebugShowID);
}
else
{
UIManager.Instance.CloseWindow(UINameConst.UIDebugShowID);
}
}
}
private bool _showCharacterID = false;
[Category("Level")]
public bool ShowPrepareRegion
{
get { return _showPrepareRegion; }
set
{
_showPrepareRegion = value;
if (_showPrepareRegion)
{
AreaManager.instance.readyAreaManager.ShowReadyArea();
}
else
{
AreaManager.instance.readyAreaManager.HideReadyArea();
}
}
}
private bool _showPrepareRegion = false;
[Category("Level")]
public bool ShowMapDebugInfo
{
get { return _showMapDebugInfo; }
set
{
_showMapDebugInfo = value;
LevelManager.Instance?.CurrentLevel?.Map?.ShowInfo(_showMapDebugInfo ? -1 : 0);
}
}
private bool _showMapDebugInfo = false;
//
// [Category("Level")]
// public bool Pause {
// get { return _pause; }
// set
// {
// _pause = value;
// LevelManager.Instance.CurrentLevel.SetPause(_pause);
// }
// }
// private bool _pause = false;
//
// [Category("Level")]
// public float Speed {
// get { return _speed; }
// set
// {
// _speed = value;
// LevelManager.Instance.CurrentLevel.SetSpeed(_speed);
// }
// }
// private float _speed = ELevelSpeed.Normal;
[Category("Level")]
public void StageSuccess()
{
LevelManager.Instance.CurrentLevel?.EnterNextStage();
}
[Category("Level")]
public void LevelSuccess()
{
LevelManager.Instance.TryExitLevel(true);
}
[Category("Level")]
public void LevelFail()
{
LevelManager.Instance.TryExitLevel(false);
}
}
|
||||
using System.Collections.Generic;
using System.ComponentModel;
using Framework;
using Framework.Wrapper;
using Gameplay;
using Gameplay.Area;
using Gameplay.Character;
using Gameplay.Level;
using Gameplay.SubSystems;
using UnityEngine;
public partial class SROptions
{
[Category("Level")]
public int LevelId
{
get { return _levelId; }
set { _levelId = value; }
}
private int _levelId = 101;
[Category("Level")]
public void EnterLevel()
{
LevelManager.Instance.TryEnterLevel(LevelId);
}
[Category("Level")]
public void EnterPVPLevel()
{
var pvpData = new PVPDefenderData();
pvpData.gameUnitInfos.Add(new()
{
unitID = 100001,
position = new Vector2Int(5,5),
});
pvpData.gameUnitInfos.Add(new()
{
unitID = 100002,
position = new Vector2Int(5,6),
});
pvpData.gameUnitInfos.Add(new()
{
unitID = 100003,
position = new Vector2Int(5,7),
});
pvpData.gameUnitInfos.Add(new()
{
unitID = 300001,
position = new Vector2Int(5,8),
type = Unit.UnitType.Vehicle,
});
LevelManager.Instance.TryEnterLevel(TableManager.Instance.Tables.GlobalConfig.PVPLevelID,null,pvpData);
}
[Category("Level")]
public bool ShowCharacterID
{
get { return _showCharacterID; }
set
{
_showCharacterID = value;
if (_showCharacterID)
{
UIManager.Instance.OpenWindow(UINameConst.UIDebugShowID);
}
else
{
UIManager.Instance.CloseWindow(UINameConst.UIDebugShowID);
}
}
}
private bool _showCharacterID = false;
[Category("Level")]
public bool ShowPrepareRegion
{
get { return _showPrepareRegion; }
set
{
_showPrepareRegion = value;
if (_showPrepareRegion)
{
AreaManager.instance.readyAreaManager.ShowReadyArea();
}
else
{
AreaManager.instance.readyAreaManager.HideReadyArea();
}
}
}
private bool _showPrepareRegion = false;
[Category("Level")]
public bool ShowMapDebugInfo
{
get { return _showMapDebugInfo; }
set
{
_showMapDebugInfo = value;
LevelManager.Instance?.CurrentLevel?.Map?.ShowInfo(_showMapDebugInfo ? -1 : 0);
}
}
private bool _showMapDebugInfo = false;
//
// [Category("Level")]
// public bool Pause {
// get { return _pause; }
// set
// {
// _pause = value;
// LevelManager.Instance.CurrentLevel.SetPause(_pause);
// }
// }
// private bool _pause = false;
//
// [Category("Level")]
// public float Speed {
// get { return _speed; }
// set
// {
// _speed = value;
// LevelManager.Instance.CurrentLevel.SetSpeed(_speed);
// }
// }
// private float _speed = ELevelSpeed.Normal;
[Category("Level")]
public void StageSuccess()
{
LevelManager.Instance.CurrentLevel?.EnterNextStage();
}
[Category("Level")]
public void LevelSuccess()
{
LevelManager.Instance.TryExitLevel(true);
}
[Category("Level")]
public void LevelFail()
{
LevelManager.Instance.TryExitLevel(false);
}
}
|
||||
|
|
@ -30,16 +30,19 @@ namespace Gameplay.Level
|
|||
|
||||
private StateMachine _stateMachine = new StateMachine();
|
||||
public bool isInBattle = false;
|
||||
private object _param;
|
||||
|
||||
public int ID => _id;
|
||||
public Map Map => _map;
|
||||
|
||||
public float LevelTime { set; get; }
|
||||
|
||||
public bool IsPvPLevel => _id == TableManager.Instance.Tables.GlobalConfig.PVPLevelID;
|
||||
|
||||
public Level(int leveId)
|
||||
public Level(int leveId, object param = null)
|
||||
{
|
||||
_id = leveId;
|
||||
_param = param;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
|
@ -55,12 +58,12 @@ namespace Gameplay.Level
|
|||
{
|
||||
await GameSceneManager.Instance.LoadSceneAsync(_currLevelInfo.LevelScene);
|
||||
}
|
||||
|
||||
|
||||
private async UniTask UnLoadScene()
|
||||
{
|
||||
await GameSceneManager.Instance.UnLoadSceneAsync(_currLevelInfo.LevelScene);
|
||||
}
|
||||
|
||||
|
||||
private async UniTask LoadData()
|
||||
{
|
||||
_levelData = _currLevelInfo.LevelData;
|
||||
|
|
@ -70,18 +73,26 @@ namespace Gameplay.Level
|
|||
{
|
||||
// if (_levelData != null)
|
||||
// {
|
||||
// if (_map != null)
|
||||
// {
|
||||
// MapUtils.RemoveCameraController(CameraManager.Instance.MainCamera);
|
||||
// MapUtils.UnLoadMap(_map);
|
||||
// }
|
||||
// if (_map != null)
|
||||
// {
|
||||
// MapUtils.RemoveCameraController(CameraManager.Instance.MainCamera);
|
||||
// MapUtils.UnLoadMap(_map);
|
||||
// }
|
||||
|
||||
_map = await MapUtils.LoadMap(_currLevelInfo.MapData);
|
||||
MapUtils.BindCameraController(CameraManager.Instance.MainCamera, _map);
|
||||
_map = await MapUtils.LoadMap(_currLevelInfo.MapData);
|
||||
MapUtils.BindCameraController(CameraManager.Instance.MainCamera, _map);
|
||||
//}
|
||||
}
|
||||
|
||||
private async UniTask LoadNpc()
|
||||
{
|
||||
if (!IsPvPLevel)
|
||||
await LoadNPCFromLevelData();
|
||||
else
|
||||
LoadNPCFromPVPData();
|
||||
}
|
||||
|
||||
private async UniTask LoadNPCFromLevelData()
|
||||
{
|
||||
if (_levelData != null && _map != null)
|
||||
{
|
||||
|
|
@ -93,12 +104,14 @@ namespace Gameplay.Level
|
|||
var teamId = ETroopsId.Enemy1;
|
||||
var cellIndex = _map.BlockPosition2TGSCellIndex(npcInfo.position);
|
||||
var yaw = LevelUtils.SetCharaterToward(npcInfo.npcToward);
|
||||
var npcCharacter = await GameUnitManager.instance.PrepareNpc(npcInfo, teamId) as Character.Character;
|
||||
var npcCharacter =
|
||||
await GameUnitManager.instance.PrepareNpc(npcInfo, teamId) as Character.Character;
|
||||
if (npcCharacter == null)
|
||||
{
|
||||
DebugUtil.LogError("创建npc失败");
|
||||
continue;
|
||||
}
|
||||
|
||||
npcCharacter.runtimeData.characterLevelData = new CharacterLevelData()
|
||||
{
|
||||
AttachAIName = npcInfo.attachAIType,
|
||||
|
|
@ -107,12 +120,74 @@ namespace Gameplay.Level
|
|||
NpcToward = npcInfo.npcToward,
|
||||
PatrolInfos = npcInfo.patrolInfos
|
||||
};
|
||||
|
||||
|
||||
GameUnitManager.instance.MoveUnitToFight(npcCharacter.GetID(), cellIndex, yaw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void LoadNPCFromPVPData()
|
||||
{
|
||||
var pvpDefenderData = _param as PVPDefenderData;
|
||||
if (pvpDefenderData == null)
|
||||
{
|
||||
DebugUtil.LogError("pvp参数不合法!");
|
||||
}
|
||||
|
||||
for (var i = 0; i < pvpDefenderData.gameUnitInfos.Count; i++)
|
||||
{
|
||||
var pvpUnitData = pvpDefenderData.gameUnitInfos[i];
|
||||
var id = (uint)pvpUnitData.unitID;
|
||||
|
||||
var teamId = ETroopsId.Enemy1;
|
||||
GameUnit unit = null;
|
||||
switch (pvpUnitData.type)
|
||||
{
|
||||
case Framework.Wrapper.Unit.UnitType.Charactor:
|
||||
var cInfo = CharacterDataInfoManager.Instance.GetCharacterInfo(id);
|
||||
if (cInfo == null)
|
||||
{
|
||||
DebugUtil.LogError("不存在的角色id: {0}", id);
|
||||
continue;
|
||||
}
|
||||
|
||||
unit = await GameUnitManager.instance.PrepareCharacter(cInfo, teamId);
|
||||
var character = (Character.Character)unit;
|
||||
character.runtimeData.characterLevelData = new CharacterLevelData()
|
||||
{
|
||||
AttachAIName = pvpUnitData.attachAIType,
|
||||
AIName = pvpUnitData.aiType,
|
||||
BornPosition = pvpUnitData.position,
|
||||
NpcToward = _levelData.pvpDefendToward,
|
||||
PatrolInfos = new(),
|
||||
};
|
||||
break;
|
||||
case Framework.Wrapper.Unit.UnitType.Vehicle:
|
||||
var vInfo = VehicleCultivateDataManager.Instance.GetVehicleCultivateData(id);
|
||||
if (vInfo == null)
|
||||
{
|
||||
DebugUtil.LogError("不存在的载具id: {0}", id);
|
||||
continue;
|
||||
}
|
||||
|
||||
unit = await GameUnitManager.instance.PrepareVehicle(vInfo, teamId);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (unit == null)
|
||||
{
|
||||
DebugUtil.LogError("创建pvp unit失败");
|
||||
continue;
|
||||
}
|
||||
|
||||
var cellIndex = _map.BlockPosition2TGSCellIndex(pvpUnitData.position);
|
||||
var yaw = LevelUtils.SetCharaterToward(_levelData.pvpDefendToward);
|
||||
GameUnitManager.instance.MoveUnitToFight(unit.GetID(), cellIndex, yaw);
|
||||
}
|
||||
}
|
||||
|
||||
// public void BindMap(Map map)
|
||||
// {
|
||||
// if (map != null)
|
||||
|
|
@ -171,7 +246,7 @@ namespace Gameplay.Level
|
|||
public async UniTask Load()
|
||||
{
|
||||
LoadConfigLevel();
|
||||
|
||||
|
||||
// GameUnitManager.instance.PrepareUnits();
|
||||
|
||||
await LoadScene();
|
||||
|
|
@ -213,7 +288,7 @@ namespace Gameplay.Level
|
|||
{
|
||||
// 加载后处理
|
||||
await _LoadPostProcess();
|
||||
|
||||
|
||||
AreaManager.CreateInstance();
|
||||
|
||||
// 表情相关
|
||||
|
|
@ -288,4 +363,4 @@ namespace Gameplay.Level
|
|||
return StringManager.Instance.GetLocalizeTextByKey(string.Format(DescKey, _id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -155,6 +155,14 @@ namespace Gameplay.Level
|
|||
[HideInInspector]
|
||||
public int enemyFallbackRegionId;
|
||||
|
||||
[LabelText("PVP防守区")]
|
||||
[HideInInspector]
|
||||
public int pvpDefendRegionId;
|
||||
|
||||
[LabelText("PVP防守方朝向")]
|
||||
[HideInInspector]
|
||||
public CharacterToward pvpDefendToward;
|
||||
|
||||
[LabelText("天气")]
|
||||
public WeatherType weatherType = WeatherType.Sunny;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ namespace Gameplay.Level
|
|||
const int NO_LEVEL_FLAG = -1;
|
||||
|
||||
private int _levelIDTryToEnter = NO_LEVEL_FLAG;
|
||||
private object _levelParam;
|
||||
private Action _enterLevelFinishCallBack;
|
||||
private Action _exitLevelFinishCallBack;
|
||||
|
||||
|
|
@ -32,6 +33,7 @@ namespace Gameplay.Level
|
|||
UnregisterEventAction();
|
||||
_enterLevelFinishCallBack = null;
|
||||
_exitLevelFinishCallBack = null;
|
||||
_levelParam = null;
|
||||
}
|
||||
|
||||
private void RegisterEventAction()
|
||||
|
|
@ -99,7 +101,7 @@ namespace Gameplay.Level
|
|||
#region API
|
||||
|
||||
//向服务器发送消息准备进入关卡
|
||||
public void TryEnterLevel(int id, Action finishCallback = null)
|
||||
public void TryEnterLevel(int id, Action finishCallback = null, object param = null)
|
||||
{
|
||||
if (IsInLevel)
|
||||
{
|
||||
|
|
@ -121,6 +123,7 @@ namespace Gameplay.Level
|
|||
|
||||
NetHelper.EnterLevel((uint)id, 0);
|
||||
_enterLevelFinishCallBack = finishCallback;
|
||||
_levelParam = param;
|
||||
_levelIDTryToEnter = id;
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +144,7 @@ namespace Gameplay.Level
|
|||
|
||||
public void ExitLevelDirectly()
|
||||
{
|
||||
if(!CurrLevel.IsStory)
|
||||
if (!CurrLevel.IsStory)
|
||||
TeamManager.Instance.Release();
|
||||
CurrLevel = null;
|
||||
IsInLevel = false;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Gameplay.Level
|
|||
|
||||
public async UniTask LoadLevel(int leveId)
|
||||
{
|
||||
CurrentLevel = new Level(leveId);
|
||||
CurrentLevel = new Level(leveId, _levelParam);
|
||||
await CurrentLevel.Load();
|
||||
await UniTask.NextFrame();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b7c9690f5240f71449a52da20ef1f579
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Framework.Wrapper;
|
||||
using Gameplay.Level;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// pvp防守方上阵数据
|
||||
/// </summary>
|
||||
public class PVPDefenderData
|
||||
{
|
||||
public List<PVPUnitInfo> gameUnitInfos = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单个战斗单元数据
|
||||
/// </summary>
|
||||
public class PVPUnitInfo
|
||||
{
|
||||
public int unitID;
|
||||
|
||||
public Unit.UnitType type = Unit.UnitType.Charactor;
|
||||
|
||||
public Vector2Int position;
|
||||
|
||||
public LevelData.AIType aiType = LevelData.AIType.BasicAI;
|
||||
|
||||
public LevelData.AttachAIType attachAIType = LevelData.AttachAIType.ChainAI;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: acfc68fb3391dd44c8aae262c6a95d29
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"preparingRegionId": 0,
|
||||
"preparingRegionToward": 0,
|
||||
"fallbackRegionId": 0,
|
||||
"enemyFallbackRegionId": 0,
|
||||
"pvpDefendRegionId": 1,
|
||||
"pvpDefendToward": 4,
|
||||
"weatherType": 0,
|
||||
"dayNightType": 0,
|
||||
"stages": [
|
||||
{
|
||||
"successCondition": {
|
||||
"conditionType": 4,
|
||||
"conditionArgs": []
|
||||
},
|
||||
"failConditions": [
|
||||
{
|
||||
"conditionType": 7,
|
||||
"conditionArgs": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"starTarget": [
|
||||
{
|
||||
"conditionType": 0,
|
||||
"conditionArgs": []
|
||||
},
|
||||
{
|
||||
"conditionType": 0,
|
||||
"conditionArgs": []
|
||||
},
|
||||
{
|
||||
"conditionType": 0,
|
||||
"conditionArgs": []
|
||||
}
|
||||
],
|
||||
"npcInfos": []
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5390e63b29d436548b797cc1dd9d40f2
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,361 @@
|
|||
{
|
||||
"position": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"_width": 10,
|
||||
"_height": 10,
|
||||
"environmentType": 0,
|
||||
"BlocksData": [
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
},
|
||||
{
|
||||
"TerrainTypeIndex": -1
|
||||
}
|
||||
],
|
||||
"regions": [
|
||||
{
|
||||
"positions": [
|
||||
25,
|
||||
24,
|
||||
23,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
45,
|
||||
44,
|
||||
43,
|
||||
13,
|
||||
14,
|
||||
54,
|
||||
53
|
||||
]
|
||||
},
|
||||
{
|
||||
"positions": [
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
74,
|
||||
87,
|
||||
86,
|
||||
85,
|
||||
84,
|
||||
73,
|
||||
72,
|
||||
83,
|
||||
82,
|
||||
91,
|
||||
92,
|
||||
93,
|
||||
95,
|
||||
96,
|
||||
94,
|
||||
97,
|
||||
98,
|
||||
88
|
||||
]
|
||||
}
|
||||
],
|
||||
"initialCameraPosition": {
|
||||
"x": 2,
|
||||
"y": 5
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 820d1e3613b8fe64883a039dc9e827d1
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -37,6 +37,12 @@ public class LevelEditorWindow : OdinEditorWindow
|
|||
[LabelText("敌方撤退区")]
|
||||
public int enemyFallbackRegionId;
|
||||
|
||||
[LabelText("PVP防守区")]
|
||||
public int pvpDefendRegionId;
|
||||
|
||||
[LabelText("PVP防守方朝向")]
|
||||
public LevelData.CharacterToward pvpDefendToward;
|
||||
|
||||
private void OnRegionChanged()
|
||||
{
|
||||
var regionslist = currWindow._curMap.MapData.regions;
|
||||
|
|
@ -97,8 +103,8 @@ public class LevelEditorWindow : OdinEditorWindow
|
|||
|
||||
private bool ResponseClickOnCell => isEditingNPC || IsEditingPatrolInfo;
|
||||
|
||||
[LabelText("关卡名称"), Indent]
|
||||
public string levelName;
|
||||
// [LabelText("关卡名称"), Indent]
|
||||
// public string levelName;
|
||||
|
||||
[LabelText("当前关卡数据"), Indent]
|
||||
[OnValueChanged("OnCurrentLevelDataChanged")]
|
||||
|
|
@ -144,6 +150,8 @@ public class LevelEditorWindow : OdinEditorWindow
|
|||
currentLevelData.fallbackRegionId = curRegionData.fallbackRegionId;
|
||||
currentLevelData.enemyFallbackRegionId = curRegionData.enemyFallbackRegionId;
|
||||
currentLevelData.preparingRegionToward = curRegionData.preparingRegionToward;
|
||||
currentLevelData.pvpDefendRegionId = curRegionData.pvpDefendRegionId;
|
||||
currentLevelData.pvpDefendToward = curRegionData.pvpDefendToward;
|
||||
|
||||
//NPC列表
|
||||
currentLevelData.npcInfos = CurrentNpcInfo.Select(editorNPCInfo => editorNPCInfo.npcInfo).ToList();
|
||||
|
|
@ -258,7 +266,10 @@ public class LevelEditorWindow : OdinEditorWindow
|
|||
curRegionData.fallbackRegionId = currentLevelData.fallbackRegionId;
|
||||
curRegionData.enemyFallbackRegionId = currentLevelData.enemyFallbackRegionId;
|
||||
curRegionData.preparingRegionToward = currentLevelData.preparingRegionToward;
|
||||
|
||||
curRegionData.pvpDefendRegionId = currentLevelData.pvpDefendRegionId;
|
||||
curRegionData.pvpDefendToward = currentLevelData.pvpDefendToward;
|
||||
|
||||
|
||||
_mapManager = FindObjectOfType<MapManager>();
|
||||
_curMap = _mapManager.Map;
|
||||
|
||||
|
|
@ -420,11 +431,11 @@ public class LevelEditorWindow : OdinEditorWindow
|
|||
if (i > 0)
|
||||
{
|
||||
Handles.color = Color.yellow;
|
||||
EditorUtil.DrawArrowInScene(lastWorldPos, worldPos,0.5f);
|
||||
EditorUtil.DrawArrowInScene(lastWorldPos, worldPos, 0.5f);
|
||||
}
|
||||
|
||||
//Handles.color = Color.black;
|
||||
Handles.Label(worldPos,i.ToString());
|
||||
Handles.Label(worldPos, i.ToString());
|
||||
lastWorldPos = worldPos;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9b7c824f96d4fce439bee7002dc9710b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e33cf495c7b7f8444acc819b64c61687
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue