Update
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Continentis.MainGame.Character;
|
||||
using DG.Tweening;
|
||||
using Lean.Pool;
|
||||
using SLSFramework.UModAssistance;
|
||||
using UnityEngine;
|
||||
@@ -67,8 +68,7 @@ namespace Continentis.MainGame.Combat
|
||||
combatCharacterViews.Add(view);
|
||||
}
|
||||
|
||||
SetViewPositions();
|
||||
SetViewHUDs();
|
||||
SetViewPositions(0);
|
||||
|
||||
//ModManager.CreateInstance<CharacterCombatBuffBase>("Basic.Buffs.Weak", 2).Apply(enemies[0]);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace Continentis.MainGame.Combat
|
||||
npc.InitializeCards();
|
||||
|
||||
Vector3 eulerAngles = fraction == Fraction.Enemy ? new Vector3(0, 180, 0) : Vector3.zero;
|
||||
CombatCharacterViewBase view = npc.GenerateCharacterView(new Vector3(0, -2, 0));
|
||||
CombatCharacterViewBase view = npc.GenerateCharacterView(new Vector3(0, -1, 0));
|
||||
view.mainView.transform.localEulerAngles = eulerAngles;
|
||||
|
||||
npcs[fraction].Add(npc);
|
||||
@@ -99,10 +99,9 @@ namespace Continentis.MainGame.Combat
|
||||
}
|
||||
|
||||
SetViewPositions();
|
||||
SetViewHUDs();
|
||||
}
|
||||
|
||||
public void SetViewPositions()
|
||||
public void SetViewPositions(float transitionDuration = 0.25f)
|
||||
{
|
||||
float playerSideLeftBound = -7.5f;
|
||||
float playerSideRightBound = -1.5f;
|
||||
@@ -118,7 +117,19 @@ namespace Continentis.MainGame.Combat
|
||||
{
|
||||
float xPos = playerSideLeftBound + index * playerBaseInterval;
|
||||
Vector3 position = new Vector3(xPos, -1, 0);
|
||||
playerHeroes[index].characterView.transform.position = position;
|
||||
|
||||
if (transitionDuration > 0f)
|
||||
{
|
||||
playerHeroes[index].characterView.transform.DOMove(position, transitionDuration)
|
||||
.SetEase(Ease.InOutSine)
|
||||
.OnComplete(SetViewHUDs)
|
||||
.Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
playerHeroes[index].characterView.transform.position = position;
|
||||
SetViewHUDs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +147,18 @@ namespace Continentis.MainGame.Combat
|
||||
{
|
||||
float xPos = enemySideLeftBound + index * enemyBaseInterval;
|
||||
Vector3 position = new Vector3(xPos, -1, 0);
|
||||
enemies[index].characterView.transform.position = position;
|
||||
if (transitionDuration > 0f)
|
||||
{
|
||||
enemies[index].characterView.transform.DOMove(position, transitionDuration)
|
||||
.SetEase(Ease.InOutSine)
|
||||
.OnComplete(SetViewHUDs)
|
||||
.Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
enemies[index].characterView.transform.position = position;
|
||||
SetViewHUDs();
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log($"Enemy are sorted: {string.Join(", ", enemies.Select(e => e.data.displayName))}");
|
||||
@@ -207,7 +229,6 @@ namespace Continentis.MainGame.Combat
|
||||
Object.Destroy(character.characterView.gameObject);
|
||||
|
||||
SetViewPositions();
|
||||
SetViewHUDs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user