骑士插图,UI调整
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Continentis.MainGame.Combat
|
||||
foreach (var data in playerHeroDataList)
|
||||
{
|
||||
PlayerHero hero = new PlayerHero(data, Fraction.Player);
|
||||
CombatCharacterViewBase view = hero.GenerateCharacterView(new Vector3(-4.5f, 0, 0));
|
||||
CombatCharacterViewBase view = hero.GenerateCharacterView(new Vector3(-4.5f, -2, 0));
|
||||
|
||||
playerHeroes.Add(hero);
|
||||
characters.Add(hero);
|
||||
@@ -55,7 +55,7 @@ namespace Continentis.MainGame.Combat
|
||||
foreach (var data in enemyDataList)
|
||||
{
|
||||
CombatNPC enemy = new CombatNPC(data, Fraction.Enemy);
|
||||
CombatCharacterViewBase view = enemy.GenerateCharacterView(new Vector3(4.5f, 0, 0));
|
||||
CombatCharacterViewBase view = enemy.GenerateCharacterView(new Vector3(4.5f, -2, 0));
|
||||
view.mainView.transform.localEulerAngles = new Vector3(0, 180, 0);
|
||||
|
||||
enemies.Add(enemy);
|
||||
@@ -86,7 +86,7 @@ namespace Continentis.MainGame.Combat
|
||||
npc.InitializeCards();
|
||||
|
||||
Vector3 eulerAngles = fraction == Fraction.Enemy ? new Vector3(0, 180, 0) : Vector3.zero;
|
||||
CombatCharacterViewBase view = npc.GenerateCharacterView(Vector3.zero);
|
||||
CombatCharacterViewBase view = npc.GenerateCharacterView(new Vector3(0, -2, 0));
|
||||
view.mainView.transform.localEulerAngles = eulerAngles;
|
||||
|
||||
npcs[fraction].Add(npc);
|
||||
@@ -100,28 +100,28 @@ namespace Continentis.MainGame.Combat
|
||||
|
||||
public void SetViewPositions()
|
||||
{
|
||||
float playerSideLeftBound = -8f;
|
||||
float playerSideRightBound = -2f;
|
||||
float playerSideLeftBound = -7f;
|
||||
float playerSideRightBound = -1f;
|
||||
playerHeroes.Sort((x, y) => x.data.combatPositionOrder.CompareTo(y.data.combatPositionOrder));
|
||||
for (int index = 0; index < playerHeroes.Count; index++)
|
||||
{
|
||||
float xPos = playerHeroes.Count > 1
|
||||
? Mathf.Lerp(playerSideLeftBound, playerSideRightBound, (float)index / (playerHeroes.Count - 1))
|
||||
: (playerSideLeftBound + playerSideRightBound) / 2;
|
||||
Vector3 position = new Vector3(xPos, 0, 0);
|
||||
Vector3 position = new Vector3(xPos, -1, 0);
|
||||
playerHeroes[index].characterView.transform.position = position;
|
||||
}
|
||||
|
||||
|
||||
float enemySideLeftBound = 2f;
|
||||
float enemySideRightBound = 8f;
|
||||
float enemySideLeftBound = 1f;
|
||||
float enemySideRightBound = 7f;
|
||||
enemies.Sort((x, y) => y.data.combatPositionOrder.CompareTo(x.data.combatPositionOrder));
|
||||
for (int index = 0; index < enemies.Count; index++)
|
||||
{
|
||||
float xPos = enemies.Count > 1
|
||||
? Mathf.Lerp(enemySideLeftBound, enemySideRightBound, (float)index / (enemies.Count - 1))
|
||||
: (enemySideLeftBound + enemySideRightBound) / 2;
|
||||
Vector3 position = new Vector3(xPos, 0, 0);
|
||||
Vector3 position = new Vector3(xPos, -1, 0);
|
||||
enemies[index].characterView.transform.position = position;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user