补充逻辑
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.2 KiB |
@ -89,32 +89,30 @@ namespace GameLogic
|
||||
/// <summary>
|
||||
/// 计算百分比大小值
|
||||
/// </summary>
|
||||
public void UpdateScale(long value)
|
||||
public void UpdateScale()
|
||||
{
|
||||
// 避免除0
|
||||
if (value == 0)
|
||||
|
||||
if (DataGameSceneManager.Instance.m_TeamSortList.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 基于当前总值,计算自己scale大小
|
||||
var results = this.m_AllPush / (float)value;
|
||||
// 获取当前第一名的值
|
||||
long oneNum = DataGameSceneManager.Instance.m_TeamSortList[0].GetAllPower();
|
||||
|
||||
Log.Debug(results);
|
||||
|
||||
// 求出实际值
|
||||
var s = EventConts.MaxActorScale * results;
|
||||
//var s = results * EventConts.actorScaleConst + sclaeAdd;
|
||||
|
||||
if (s < EventConts.MinActorScale)
|
||||
if (oneNum == 0)
|
||||
{
|
||||
s = EventConts.MinActorScale;
|
||||
}
|
||||
else if (s >= EventConts.MaxActorScale)
|
||||
{
|
||||
s = EventConts.MaxActorScale;
|
||||
m_imgValue.fillAmount = 0.1f;
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算自己的百分比
|
||||
float percent = (float)m_AllPush / oneNum;
|
||||
if (percent > 1)
|
||||
{
|
||||
percent = 1;
|
||||
}
|
||||
m_imgValue.fillAmount = percent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,38 +237,8 @@ namespace GameLogic
|
||||
foreach (var item in m_TeamSortList)
|
||||
{
|
||||
// 执行内部更新
|
||||
item.UpdateScale(allValue);
|
||||
item.UpdateScale();
|
||||
}
|
||||
|
||||
|
||||
// // Determine the scale for the top team
|
||||
// float topTeamScale = 25.0f;
|
||||
|
||||
// // Calculate the scale for each team based on their score relative to the top team
|
||||
// foreach (var item in m_TeamLists)
|
||||
// {
|
||||
// float teamScore = item.Value.GetPush();
|
||||
// float scale = 0;
|
||||
// float powerFactor = 1.5f; // 调整这个值以增加或减少悬殊比
|
||||
// scale = Mathf.Pow((teamScore / allValue), powerFactor) * topTeamScale;
|
||||
|
||||
// if (isNoAdd)
|
||||
// {
|
||||
// scale = 10;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // 限制scale最大最小值
|
||||
// float minScale = 5.0f;
|
||||
// float maxScale = 25.0f;
|
||||
// scale = Mathf.Clamp(scale, minScale, maxScale);
|
||||
// }
|
||||
|
||||
|
||||
// item.Value.UpdateScale(scale);
|
||||
// }
|
||||
|
||||
GameEvent.Send(EventConts.UpdateHItem, allValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -106,6 +106,19 @@ namespace GameLogic
|
||||
float speed = distance / 0.2f; // Calculate speed to ensure movement completes in 1 second
|
||||
rectTransform.localPosition = Vector2.MoveTowards(rectTransform.localPosition, targetPosition, speed * Time.deltaTime);
|
||||
}
|
||||
|
||||
DataGameSceneManager.Instance.m_TeamSortList.Sort((a, b) =>
|
||||
{
|
||||
if (a.GetAllPower() > b.GetAllPower())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected override void RegisterEvent()
|
||||
@ -237,7 +250,7 @@ namespace GameLogic
|
||||
{
|
||||
if (i < DataGameSceneManager.Instance.m_TeamSortList.Count)
|
||||
{
|
||||
var hItemActor = DataGameSceneManager.Instance.m_TeamSortList[i];
|
||||
var hItemActor = DataGameSceneManager.Instance.m_DicTeamList[(i + 1).ToString()];
|
||||
long score = hItemActor.GetAllPower(); // Assume GetScore() returns the score of the actor
|
||||
hItemActors.Add((hItemActor, score));
|
||||
}
|
||||
|
@ -6,9 +6,33 @@ EditorUserSettings:
|
||||
serializedVersion: 4
|
||||
m_ConfigSettings:
|
||||
RecentlyUsedSceneGuid-0:
|
||||
value: 5754500456065b0b550d087413710644401549292f7d2063297a1c6be3b5366a
|
||||
value: 51080d54530d0b0b5858592312765d4415161a79747e7260757c4f31b2e33560
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-1:
|
||||
value: 500257505d040f590b0f0a7a167b0c4445154f2b7e7c2360287c4d67bbb8363b
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-2:
|
||||
value: 0153065303055e0c590f557447775b444115192c7a2c72312c7e1c31b6e23661
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-3:
|
||||
value: 55520c5e50535c0c5c5b5c2349745a44151649287c7c71342e704930e1b1306d
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-4:
|
||||
value: 075401035d535c0b5a0d5a7745775d44464e40737f2d75662b2c1c67e1b8306a
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-5:
|
||||
value: 5a05015552505b030b5e5976487706444e161a7b2f2c24632e284e30e1b56c60
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-6:
|
||||
value: 5305055304565c0c5b0f0f7516210b4410161d2f282e74677d791960b5e4376c
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-7:
|
||||
value: 5a040503530058085a58087149215e4410164f2f792d24342c7a4831e6e1363c
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-8:
|
||||
value: 5a54550354500d0c0f0a5d7541265e44424f1b7829717167792b1961bbe1626e
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-9:
|
||||
value: 02500105010d500359565b7616225a44474e4c7d7b2c27337b7f4d31b1b8666f
|
||||
flags: 0
|
||||
UnityEditor.ShaderGraph.Blackboard:
|
||||
|