Improve this

This commit is contained in:
Lncvrt committed 2026-03-05 22:00:54 -07:00
1 parent 3b7c4d6d5e
commit 4607c8bffc
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -74,7 +74,7 @@ public class AutoGamePlayer : MonoBehaviour {
float birdX = bird.GetComponent<RectTransform>().anchoredPosition.x; float birdX = bird.GetComponent<RectTransform>().anchoredPosition.x;
float birdY = bird.GetComponent<RectTransform>().anchoredPosition.y; float birdY = bird.GetComponent<RectTransform>().anchoredPosition.y;
var berryScores = new System.Collections.Generic.Dictionary<string, float> { var berryScores = new Dictionary<string, float> {
{ "NormalBerry", 1f }, { "NormalBerry", 1f },
{ "UltraBerry", 5f }, { "UltraBerry", 5f },
{ "SpeedyBerry", 10f }, { "SpeedyBerry", 10f },
@@ -85,7 +85,7 @@ public class AutoGamePlayer : MonoBehaviour {
{ "AntiBerry", -10f }, { "AntiBerry", -10f },
}; };
var allBerries = new System.Collections.Generic.List<(float x, float y, float score)>(); var allBerries = new List<(float x, float y, float score)>();
foreach (var kvp in berryScores) { foreach (var kvp in berryScores) {
foreach (var b in GameObject.FindGameObjectsWithTag(kvp.Key)) { foreach (var b in GameObject.FindGameObjectsWithTag(kvp.Key)) {
var rt = b.GetComponent<RectTransform>(); var rt = b.GetComponent<RectTransform>();
@@ -134,7 +134,7 @@ public class AutoGamePlayer : MonoBehaviour {
doMoveLeft = closestBadX >= birdX; doMoveLeft = closestBadX >= birdX;
doMoveRight = closestBadX < birdX; doMoveRight = closestBadX < birdX;
} else { } else {
var clusters = new System.Collections.Generic.List<(float x, float y, float score)>(); var clusters = new List<(float x, float y, float score)>();
var used = new bool[allBerries.Count]; var used = new bool[allBerries.Count];
float clusterRadius = 1.8f; float clusterRadius = 1.8f;
@@ -209,7 +209,7 @@ public class CustomGamePlayer : MonoBehaviour {
float birdX = bird.GetComponent<RectTransform>().anchoredPosition.x; float birdX = bird.GetComponent<RectTransform>().anchoredPosition.x;
float birdY = bird.GetComponent<RectTransform>().anchoredPosition.y; float birdY = bird.GetComponent<RectTransform>().anchoredPosition.y;
var berryScores = new System.Collections.Generic.Dictionary<string, float> { var berryScores = new Dictionary<string, float> {
{ "NormalBerry", 1f }, { "NormalBerry", 1f },
{ "UltraBerry", 5f }, { "UltraBerry", 5f },
{ "SpeedyBerry", 10f }, { "SpeedyBerry", 10f },
@@ -220,7 +220,7 @@ public class CustomGamePlayer : MonoBehaviour {
{ "AntiBerry", -10f }, { "AntiBerry", -10f },
}; };
var allBerries = new System.Collections.Generic.List<(float x, float y, float score)>(); var allBerries = new List<(float x, float y, float score)>();
foreach (var kvp in berryScores) { foreach (var kvp in berryScores) {
foreach (var b in GameObject.FindGameObjectsWithTag(kvp.Key)) { foreach (var b in GameObject.FindGameObjectsWithTag(kvp.Key)) {
var rt = b.GetComponent<RectTransform>(); var rt = b.GetComponent<RectTransform>();
@@ -269,7 +269,7 @@ public class CustomGamePlayer : MonoBehaviour {
doMoveLeft = closestBadX >= birdX; doMoveLeft = closestBadX >= birdX;
doMoveRight = closestBadX < birdX; doMoveRight = closestBadX < birdX;
} else { } else {
var clusters = new System.Collections.Generic.List<(float x, float y, float score)>(); var clusters = new List<(float x, float y, float score)>();
var used = new bool[allBerries.Count]; var used = new bool[allBerries.Count];
float clusterRadius = 1.8f; float clusterRadius = 1.8f;