1 line
3.5 KiB
C#
1 line
3.5 KiB
C#
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);
|
|
}
|
|
} |