implement changes to game
This commit is contained in:
@@ -614,7 +614,7 @@ Canvas:
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
@@ -646,7 +646,7 @@ MonoBehaviour:
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_DynamicPixelsPerUnit: 64
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &3219017547776401217
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -478,7 +478,7 @@ Canvas:
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
@@ -510,7 +510,7 @@ MonoBehaviour:
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_DynamicPixelsPerUnit: 64
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &3540123012418660225
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -616,7 +616,7 @@ Canvas:
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
@@ -648,7 +648,7 @@ MonoBehaviour:
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_DynamicPixelsPerUnit: 64
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &3219017547776401217
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -616,7 +616,7 @@ Canvas:
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
@@ -648,7 +648,7 @@ MonoBehaviour:
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_DynamicPixelsPerUnit: 64
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &3219017547776401217
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -53,7 +53,7 @@ Canvas:
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
@@ -85,7 +85,7 @@ MonoBehaviour:
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_DynamicPixelsPerUnit: 64
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &2096110125144729609
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -616,7 +616,7 @@ Canvas:
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
@@ -648,7 +648,7 @@ MonoBehaviour:
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_DynamicPixelsPerUnit: 64
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &3219017547776401217
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -185,7 +185,7 @@ MonoBehaviour:
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_MatchWidthOrHeight: 0.5
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
|
||||
@@ -151,9 +151,9 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 847727677}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -632, y: 342.16}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 70, y: -35}
|
||||
m_SizeDelta: {x: 93.406, y: 53.4947}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &216754631
|
||||
@@ -203,8 +203,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 40
|
||||
m_fontSizeBase: 40
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@@ -214,6 +214,7 @@ MonoBehaviour:
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_characterHorizontalScale: 1
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
@@ -289,10 +290,10 @@ RectTransform:
|
||||
- {fileID: 1996466992}
|
||||
m_Father: {fileID: 847727677}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 323}
|
||||
m_SizeDelta: {x: 376.1932, y: 91.818}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -60}
|
||||
m_SizeDelta: {x: 210.2774, y: 71.3564}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &238369406
|
||||
MonoBehaviour:
|
||||
@@ -500,7 +501,6 @@ MonoBehaviour:
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
@@ -508,6 +508,7 @@ MonoBehaviour:
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!20 &519420031
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -727,12 +728,12 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_ScreenMatchMode: 1
|
||||
m_MatchWidthOrHeight: 0.5
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
@@ -756,6 +757,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_UseReflectionProbes: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
@@ -841,6 +843,7 @@ GameObject:
|
||||
m_IsActive: 1
|
||||
--- !u!212 &1873606334
|
||||
SpriteRenderer:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
@@ -859,6 +862,8 @@ SpriteRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -880,9 +885,11 @@ SpriteRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_MaskInteraction: 0
|
||||
m_Sprite: {fileID: -2530678351198809414, guid: d8fe0c73624c2e447a60d718d575ad8e, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
@@ -892,7 +899,6 @@ SpriteRenderer:
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!4 &1873606335
|
||||
Transform:
|
||||
@@ -1063,8 +1069,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 40
|
||||
m_fontSizeBase: 40
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@@ -1074,6 +1080,7 @@ MonoBehaviour:
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_characterHorizontalScale: 1
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
|
||||
@@ -15,6 +15,7 @@ public class Bullet : MonoBehaviour
|
||||
{
|
||||
target = enemy.transform;
|
||||
lastKnownDirection = (target.position - transform.position).normalized; // Store initial direction
|
||||
UpdateRotation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +36,21 @@ public class Bullet : MonoBehaviour
|
||||
}
|
||||
|
||||
// Move bullet in the last known direction
|
||||
UpdateRotation();
|
||||
transform.position += (Vector3)lastKnownDirection * speed * Time.deltaTime;
|
||||
|
||||
// Destroy bullet after 5 seconds to prevent infinite movement
|
||||
Destroy(gameObject, 5f);
|
||||
}
|
||||
|
||||
void UpdateRotation()
|
||||
{
|
||||
if (lastKnownDirection.sqrMagnitude <= Mathf.Epsilon)
|
||||
return;
|
||||
|
||||
transform.right = lastKnownDirection;
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Enemy"))
|
||||
@@ -58,4 +68,4 @@ public class Bullet : MonoBehaviour
|
||||
Instantiate(shatterEffectPrefab, transform.position, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,13 @@ public class EnemySpawner : MonoBehaviour
|
||||
private float maxEnemySpeed = 6f;
|
||||
private int maxEnemyHP = 20;
|
||||
|
||||
void Start()
|
||||
{
|
||||
EnsureWaveText();
|
||||
StyleStartWaveButton();
|
||||
UpdateWaveText();
|
||||
}
|
||||
|
||||
public void StartWave()
|
||||
{
|
||||
if (!isSpawning)
|
||||
@@ -83,7 +90,7 @@ public class EnemySpawner : MonoBehaviour
|
||||
{
|
||||
if (waveText != null)
|
||||
{
|
||||
waveText.text = "Wave: " + currentWave;
|
||||
waveText.text = $"WAVE {currentWave}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +104,7 @@ public class EnemySpawner : MonoBehaviour
|
||||
// If wave is multiple of 5, show special upgrade choice
|
||||
if (currentWave % 5 == 0)
|
||||
{
|
||||
UpgradeManager upgradeManager = FindObjectOfType<UpgradeManager>();
|
||||
UpgradeManager upgradeManager = FindAnyObjectByType<UpgradeManager>();
|
||||
if (upgradeManager != null)
|
||||
{
|
||||
upgradeManager.ShowSpecialUpgradeChoice();
|
||||
@@ -105,4 +112,90 @@ public class EnemySpawner : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnsureWaveText()
|
||||
{
|
||||
if (waveText != null)
|
||||
return;
|
||||
|
||||
Canvas canvas = FindAnyObjectByType<Canvas>();
|
||||
if (canvas == null)
|
||||
return;
|
||||
|
||||
Transform existing = canvas.transform.Find("WaveCounter");
|
||||
if (existing != null)
|
||||
{
|
||||
waveText = existing.GetComponentInChildren<TextMeshProUGUI>();
|
||||
if (waveText != null)
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject panelObject = new GameObject("WaveCounter", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
RectTransform panel = panelObject.GetComponent<RectTransform>();
|
||||
panel.SetParent(canvas.transform, false);
|
||||
panel.anchorMin = new Vector2(0.5f, 1f);
|
||||
panel.anchorMax = new Vector2(0.5f, 1f);
|
||||
panel.pivot = new Vector2(0.5f, 1f);
|
||||
panel.anchoredPosition = new Vector2(0f, -24f);
|
||||
panel.sizeDelta = new Vector2(150f, 42f);
|
||||
|
||||
Image panelImage = panelObject.GetComponent<Image>();
|
||||
panelImage.color = new Color(0.05f, 0.06f, 0.08f, 0.84f);
|
||||
|
||||
GameObject textObject = new GameObject("Text", typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI));
|
||||
RectTransform textRect = textObject.GetComponent<RectTransform>();
|
||||
textRect.SetParent(panel, false);
|
||||
textRect.anchorMin = Vector2.zero;
|
||||
textRect.anchorMax = Vector2.one;
|
||||
textRect.offsetMin = Vector2.zero;
|
||||
textRect.offsetMax = Vector2.zero;
|
||||
|
||||
waveText = textObject.GetComponent<TextMeshProUGUI>();
|
||||
waveText.alignment = TextAlignmentOptions.Center;
|
||||
waveText.fontSize = 21f;
|
||||
waveText.fontStyle = FontStyles.Bold;
|
||||
waveText.color = new Color(0.92f, 0.95f, 1f, 1f);
|
||||
waveText.raycastTarget = false;
|
||||
}
|
||||
|
||||
void StyleStartWaveButton()
|
||||
{
|
||||
if (startWaveButton == null)
|
||||
return;
|
||||
|
||||
RectTransform rect = startWaveButton.GetComponent<RectTransform>();
|
||||
if (rect != null)
|
||||
{
|
||||
rect.anchorMin = new Vector2(0.5f, 1f);
|
||||
rect.anchorMax = new Vector2(0.5f, 1f);
|
||||
rect.pivot = new Vector2(0.5f, 1f);
|
||||
rect.anchoredPosition = new Vector2(0f, -76f);
|
||||
rect.sizeDelta = new Vector2(180f, 44f);
|
||||
}
|
||||
|
||||
Image image = startWaveButton.GetComponent<Image>();
|
||||
if (image != null)
|
||||
{
|
||||
image.color = new Color(0.2f, 0.66f, 0.9f, 1f);
|
||||
}
|
||||
|
||||
ColorBlock colors = startWaveButton.colors;
|
||||
colors.normalColor = new Color(0.2f, 0.66f, 0.9f, 1f);
|
||||
colors.highlightedColor = new Color(0.33f, 0.78f, 1f, 1f);
|
||||
colors.pressedColor = new Color(0.12f, 0.48f, 0.7f, 1f);
|
||||
colors.selectedColor = colors.highlightedColor;
|
||||
colors.disabledColor = new Color(0.18f, 0.22f, 0.27f, 0.7f);
|
||||
colors.colorMultiplier = 1f;
|
||||
startWaveButton.colors = colors;
|
||||
|
||||
TextMeshProUGUI label = startWaveButton.GetComponentInChildren<TextMeshProUGUI>();
|
||||
if (label != null)
|
||||
{
|
||||
label.text = "START WAVE";
|
||||
label.fontSize = 20f;
|
||||
label.fontStyle = FontStyles.Bold;
|
||||
label.color = Color.white;
|
||||
label.raycastTarget = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,33 @@
|
||||
using System.Collections; // Required for IEnumerator
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
|
||||
public class TowerHealth : MonoBehaviour
|
||||
{
|
||||
public int maxHealth = 100;
|
||||
public GameObject floatingTextPrefab;
|
||||
|
||||
[Header("HUD")]
|
||||
public Image healthFill;
|
||||
public TextMeshProUGUI healthText;
|
||||
public Color highHealthColor = new Color(0.18f, 0.88f, 0.42f);
|
||||
public Color lowHealthColor = new Color(0.95f, 0.22f, 0.18f);
|
||||
|
||||
private int currentHealth;
|
||||
private SpriteRenderer spriteRenderer;
|
||||
public GameObject floatingTextPrefab;
|
||||
|
||||
void Start()
|
||||
{
|
||||
currentHealth = maxHealth;
|
||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
||||
UpdateColor();
|
||||
if (spriteRenderer != null)
|
||||
{
|
||||
spriteRenderer.color = Color.white;
|
||||
}
|
||||
|
||||
EnsureHealthBar();
|
||||
UpdateHealthBar();
|
||||
}
|
||||
|
||||
public void TakeDamage(int damage)
|
||||
@@ -21,7 +35,7 @@ public class TowerHealth : MonoBehaviour
|
||||
currentHealth -= damage;
|
||||
if (currentHealth < 0) currentHealth = 0;
|
||||
ShowFloatingDamage(damage);
|
||||
UpdateColor();
|
||||
UpdateHealthBar();
|
||||
|
||||
if (currentHealth <= 0)
|
||||
{
|
||||
@@ -29,10 +43,138 @@ public class TowerHealth : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateColor()
|
||||
void UpdateHealthBar()
|
||||
{
|
||||
float healthPercentage = (float)currentHealth / maxHealth;
|
||||
spriteRenderer.color = Color.Lerp(Color.red, Color.green, healthPercentage);
|
||||
float healthPercentage = maxHealth <= 0 ? 0f : (float)currentHealth / maxHealth;
|
||||
|
||||
if (healthFill != null)
|
||||
{
|
||||
healthFill.fillAmount = healthPercentage;
|
||||
healthFill.color = Color.Lerp(lowHealthColor, highHealthColor, healthPercentage);
|
||||
}
|
||||
|
||||
if (healthText != null)
|
||||
{
|
||||
healthText.text = $"{currentHealth}/{maxHealth}";
|
||||
}
|
||||
}
|
||||
|
||||
void EnsureHealthBar()
|
||||
{
|
||||
if (healthFill != null && healthText != null)
|
||||
return;
|
||||
|
||||
Canvas canvas = FindAnyObjectByType<Canvas>();
|
||||
if (canvas == null)
|
||||
{
|
||||
GameObject canvasObject = new GameObject("GameUI", typeof(RectTransform), typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster));
|
||||
canvas = canvasObject.GetComponent<Canvas>();
|
||||
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||
|
||||
CanvasScaler scaler = canvasObject.GetComponent<CanvasScaler>();
|
||||
scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
|
||||
scaler.referenceResolution = new Vector2(800f, 600f);
|
||||
scaler.matchWidthOrHeight = 0.5f;
|
||||
}
|
||||
|
||||
Transform existing = canvas.transform.Find("TowerHealthBar");
|
||||
RectTransform container = existing != null
|
||||
? existing.GetComponent<RectTransform>()
|
||||
: CreateRect("TowerHealthBar", canvas.transform);
|
||||
|
||||
container.anchorMin = new Vector2(1f, 1f);
|
||||
container.anchorMax = new Vector2(1f, 1f);
|
||||
container.pivot = new Vector2(1f, 1f);
|
||||
container.anchoredPosition = new Vector2(-24f, -24f);
|
||||
container.sizeDelta = new Vector2(240f, 54f);
|
||||
|
||||
Image panel = container.GetComponent<Image>();
|
||||
if (panel == null)
|
||||
panel = container.gameObject.AddComponent<Image>();
|
||||
panel.color = new Color(0.05f, 0.06f, 0.08f, 0.84f);
|
||||
|
||||
TextMeshProUGUI label = container.Find("Label")?.GetComponent<TextMeshProUGUI>();
|
||||
if (label == null)
|
||||
{
|
||||
label = CreateText("Label", container, "TOWER", 14f);
|
||||
RectTransform labelRect = label.rectTransform;
|
||||
labelRect.anchorMin = new Vector2(0f, 1f);
|
||||
labelRect.anchorMax = new Vector2(0f, 1f);
|
||||
labelRect.pivot = new Vector2(0f, 1f);
|
||||
labelRect.anchoredPosition = new Vector2(12f, -7f);
|
||||
labelRect.sizeDelta = new Vector2(90f, 18f);
|
||||
}
|
||||
|
||||
if (healthText == null)
|
||||
{
|
||||
healthText = container.Find("Value")?.GetComponent<TextMeshProUGUI>();
|
||||
if (healthText == null)
|
||||
{
|
||||
healthText = CreateText("Value", container, "", 14f);
|
||||
healthText.alignment = TextAlignmentOptions.Right;
|
||||
RectTransform textRect = healthText.rectTransform;
|
||||
textRect.anchorMin = new Vector2(1f, 1f);
|
||||
textRect.anchorMax = new Vector2(1f, 1f);
|
||||
textRect.pivot = new Vector2(1f, 1f);
|
||||
textRect.anchoredPosition = new Vector2(-12f, -7f);
|
||||
textRect.sizeDelta = new Vector2(100f, 18f);
|
||||
}
|
||||
}
|
||||
|
||||
RectTransform track = container.Find("Track")?.GetComponent<RectTransform>();
|
||||
if (track == null)
|
||||
{
|
||||
track = CreateRect("Track", container);
|
||||
track.anchorMin = new Vector2(0f, 0f);
|
||||
track.anchorMax = new Vector2(1f, 0f);
|
||||
track.pivot = new Vector2(0.5f, 0f);
|
||||
track.anchoredPosition = new Vector2(0f, 10f);
|
||||
track.sizeDelta = new Vector2(-24f, 16f);
|
||||
|
||||
Image trackImage = track.gameObject.AddComponent<Image>();
|
||||
trackImage.color = new Color(0.16f, 0.17f, 0.2f, 1f);
|
||||
}
|
||||
|
||||
if (healthFill == null)
|
||||
{
|
||||
healthFill = track.Find("Fill")?.GetComponent<Image>();
|
||||
if (healthFill == null)
|
||||
{
|
||||
RectTransform fill = CreateRect("Fill", track);
|
||||
fill.anchorMin = Vector2.zero;
|
||||
fill.anchorMax = Vector2.one;
|
||||
fill.offsetMin = Vector2.zero;
|
||||
fill.offsetMax = Vector2.zero;
|
||||
|
||||
healthFill = fill.gameObject.AddComponent<Image>();
|
||||
healthFill.type = Image.Type.Filled;
|
||||
healthFill.fillMethod = Image.FillMethod.Horizontal;
|
||||
healthFill.fillOrigin = (int)Image.OriginHorizontal.Left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static RectTransform CreateRect(string name, Transform parent)
|
||||
{
|
||||
GameObject obj = new GameObject(name, typeof(RectTransform));
|
||||
RectTransform rect = obj.GetComponent<RectTransform>();
|
||||
rect.SetParent(parent, false);
|
||||
return rect;
|
||||
}
|
||||
|
||||
static TextMeshProUGUI CreateText(string name, Transform parent, string text, float fontSize)
|
||||
{
|
||||
GameObject obj = new GameObject(name, typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI));
|
||||
RectTransform rect = obj.GetComponent<RectTransform>();
|
||||
rect.SetParent(parent, false);
|
||||
|
||||
TextMeshProUGUI label = obj.GetComponent<TextMeshProUGUI>();
|
||||
label.text = text;
|
||||
label.fontSize = fontSize;
|
||||
label.fontStyle = FontStyles.Bold;
|
||||
label.color = new Color(0.92f, 0.95f, 1f, 1f);
|
||||
label.raycastTarget = false;
|
||||
return label;
|
||||
}
|
||||
|
||||
void ShowFloatingDamage(int damage)
|
||||
@@ -68,4 +210,4 @@ public class TowerHealth : MonoBehaviour
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UpgradeCard : MonoBehaviour
|
||||
{
|
||||
@@ -22,17 +23,21 @@ public class UpgradeCard : MonoBehaviour
|
||||
public TextMeshProUGUI upgradeText;
|
||||
public TextMeshProUGUI upgradeDescription;
|
||||
public TextMeshProUGUI upgradeCostText;
|
||||
[SerializeField] private float titleFontSize = 17f;
|
||||
[SerializeField] private float detailFontSize = 11f;
|
||||
[SerializeField] private float worldCanvasDynamicPixelsPerUnit = 64f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// If not assigned in Inspector, try to find them by name
|
||||
if (upgradeText == null)
|
||||
upgradeText = transform.Find("Canvas/UpgradeText").GetComponent<TextMeshProUGUI>();
|
||||
upgradeText = FindText("Canvas/UpgradeText");
|
||||
if (upgradeDescription == null)
|
||||
upgradeDescription = transform.Find("Canvas/UpgradeDescription").GetComponent<TextMeshProUGUI>();
|
||||
upgradeDescription = FindText("Canvas/UpgradeDescription");
|
||||
if (upgradeCostText == null)
|
||||
upgradeCostText = transform.Find("Canvas/UpgradeCost").GetComponent<TextMeshProUGUI>();
|
||||
upgradeCostText = FindText("Canvas/UpgradeCost");
|
||||
|
||||
ImproveTextRendering();
|
||||
// Update all UI fields
|
||||
UpdateUpgradeUI();
|
||||
}
|
||||
@@ -45,10 +50,12 @@ public class UpgradeCard : MonoBehaviour
|
||||
|
||||
public void UpdateUpgradeUI()
|
||||
{
|
||||
ImproveTextRendering();
|
||||
|
||||
if (upgradeText != null)
|
||||
{
|
||||
string roman = ConvertToRoman(upgradeLevel);
|
||||
upgradeText.text = $"{upgradeType} {roman}";
|
||||
upgradeText.text = $"{GetDisplayName(upgradeType)} {roman}";
|
||||
}
|
||||
|
||||
// 2) Description is presumably already set in the prefab,
|
||||
@@ -65,6 +72,56 @@ public class UpgradeCard : MonoBehaviour
|
||||
string ConvertToRoman(int number)
|
||||
{
|
||||
string[] numerals = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X" };
|
||||
return number > 10 ? number.ToString() : numerals[number - 1];
|
||||
return number < 1 || number > 10 ? number.ToString() : numerals[number - 1];
|
||||
}
|
||||
}
|
||||
|
||||
static string GetDisplayName(UpgradeType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case UpgradeType.FireRate: return "FIRE RATE";
|
||||
case UpgradeType.Range: return "RANGE";
|
||||
case UpgradeType.Damage: return "DAMAGE";
|
||||
case UpgradeType.MultiShot: return "MULTI SHOT";
|
||||
case UpgradeType.Homing: return "HOMING";
|
||||
case UpgradeType.Ricochet: return "RICOCHET";
|
||||
default: return type.ToString().ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
TextMeshProUGUI FindText(string path)
|
||||
{
|
||||
Transform textTransform = transform.Find(path);
|
||||
return textTransform != null ? textTransform.GetComponent<TextMeshProUGUI>() : null;
|
||||
}
|
||||
|
||||
void ImproveTextRendering()
|
||||
{
|
||||
Canvas canvas = GetComponentInChildren<Canvas>(true);
|
||||
if (canvas != null)
|
||||
{
|
||||
canvas.pixelPerfect = true;
|
||||
}
|
||||
|
||||
CanvasScaler canvasScaler = GetComponentInChildren<CanvasScaler>(true);
|
||||
if (canvasScaler != null)
|
||||
{
|
||||
canvasScaler.dynamicPixelsPerUnit = worldCanvasDynamicPixelsPerUnit;
|
||||
}
|
||||
|
||||
ConfigureText(upgradeText, titleFontSize);
|
||||
ConfigureText(upgradeDescription, detailFontSize);
|
||||
ConfigureText(upgradeCostText, detailFontSize);
|
||||
}
|
||||
|
||||
static void ConfigureText(TextMeshProUGUI text, float fontSize)
|
||||
{
|
||||
if (text == null)
|
||||
return;
|
||||
|
||||
text.fontSize = fontSize;
|
||||
text.enableAutoSizing = false;
|
||||
text.extraPadding = true;
|
||||
text.isTextObjectScaleStatic = false;
|
||||
}
|
||||
}
|
||||
|
||||
+327
-104
@@ -1,43 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UpgradeManager : MonoBehaviour
|
||||
{
|
||||
public GameObject[] normalUpgradePrefabs; // FireRate, Range, Damage
|
||||
public GameObject[] specialUpgradePrefabs; // MultiShot, Homing, Ricochet, etc.
|
||||
public GameObject[] normalUpgradePrefabs;
|
||||
public GameObject[] specialUpgradePrefabs;
|
||||
|
||||
[HideInInspector] public List<UpgradeCard.UpgradeType> unlockedUpgrades = new List<UpgradeCard.UpgradeType>();
|
||||
// Stores which special upgrades have been permanently unlocked.
|
||||
|
||||
// UI placeholder to spawn the 3 choices
|
||||
public Transform specialUpgradeSpawnParent; // A center-of-screen parent or coordinates
|
||||
public Transform specialUpgradeSpawnParent;
|
||||
public float specialUpgradeSpacing = 2f;
|
||||
|
||||
public Tower tower;
|
||||
private Dictionary<UpgradeCard.UpgradeType, int> upgradeLevels = new Dictionary<UpgradeCard.UpgradeType, int>();
|
||||
private Dictionary<UpgradeCard.UpgradeType, int> upgradeCosts = new Dictionary<UpgradeCard.UpgradeType, int>();
|
||||
public int bits = 5;
|
||||
public TextMeshProUGUI bitsText;
|
||||
|
||||
private readonly Dictionary<UpgradeCard.UpgradeType, int> upgradeLevels = new Dictionary<UpgradeCard.UpgradeType, int>();
|
||||
private readonly Dictionary<UpgradeCard.UpgradeType, int> upgradeCosts = new Dictionary<UpgradeCard.UpgradeType, int>();
|
||||
private readonly Dictionary<UpgradeCard.UpgradeType, UpgradeCard> activeCards = new Dictionary<UpgradeCard.UpgradeType, UpgradeCard>();
|
||||
|
||||
private RectTransform upgradeDock;
|
||||
private RectTransform upgradeCardRow;
|
||||
private GameObject specialOverlay;
|
||||
|
||||
private static readonly UpgradeCard.UpgradeType[] NormalUpgradeTypes =
|
||||
{
|
||||
UpgradeCard.UpgradeType.FireRate,
|
||||
UpgradeCard.UpgradeType.Range,
|
||||
UpgradeCard.UpgradeType.Damage
|
||||
};
|
||||
|
||||
private static readonly UpgradeCard.UpgradeType[] SpecialUpgradeTypes =
|
||||
{
|
||||
UpgradeCard.UpgradeType.MultiShot,
|
||||
UpgradeCard.UpgradeType.Homing,
|
||||
UpgradeCard.UpgradeType.Ricochet
|
||||
};
|
||||
|
||||
void Start()
|
||||
{
|
||||
EnsureUpgradeDock();
|
||||
InitializeUpgrades();
|
||||
UpdateBitsText();
|
||||
Debug.Log($"specialUpgradePrefabs length: {specialUpgradePrefabs.Length}");
|
||||
}
|
||||
|
||||
public void EnemyKilled()
|
||||
{
|
||||
bits++;
|
||||
UpdateBitsText();
|
||||
UpdateUpgradeCards();
|
||||
}
|
||||
|
||||
void InitializeUpgrades()
|
||||
{
|
||||
float spacing = 2.5f;
|
||||
float startX = -((normalUpgradePrefabs.Length - 1) * spacing / 2f);
|
||||
foreach (UpgradeCard.UpgradeType type in System.Enum.GetValues(typeof(UpgradeCard.UpgradeType)))
|
||||
foreach (UpgradeCard.UpgradeType type in Enum.GetValues(typeof(UpgradeCard.UpgradeType)))
|
||||
{
|
||||
if (!upgradeLevels.ContainsKey(type))
|
||||
upgradeLevels[type] = 0;
|
||||
@@ -45,56 +64,33 @@ public class UpgradeManager : MonoBehaviour
|
||||
upgradeCosts[type] = GetBaseCost(type);
|
||||
}
|
||||
|
||||
for (int i = 0; i < normalUpgradePrefabs.Length; i++)
|
||||
foreach (UpgradeCard.UpgradeType type in NormalUpgradeTypes)
|
||||
{
|
||||
UpgradeCard.UpgradeType upgradeType = (UpgradeCard.UpgradeType)i;
|
||||
SpawnUpgradeCard(upgradeType, startX + (i * spacing));
|
||||
SpawnUpgradeCard(type, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
void SpawnUpgradeCard(UpgradeCard.UpgradeType upgradeType, float xPos)
|
||||
{
|
||||
Vector3 spawnPosition = new Vector3(xPos, -4f, 0);
|
||||
if (activeCards.ContainsKey(upgradeType))
|
||||
return;
|
||||
|
||||
// Ensure dictionaries have entries for this type
|
||||
if (!upgradeLevels.ContainsKey(upgradeType))
|
||||
upgradeLevels[upgradeType] = 0;
|
||||
if (!upgradeCosts.ContainsKey(upgradeType))
|
||||
upgradeCosts[upgradeType] = GetBaseCost(upgradeType);
|
||||
EnsureUpgradeDock();
|
||||
|
||||
// Determine this upgrade's current level
|
||||
int currentLevel = upgradeLevels[upgradeType] + 1;
|
||||
GameObject cardObject = CreateUpgradeCardObject(upgradeType, upgradeCardRow, false);
|
||||
UpgradeCard upgradeCard = cardObject.GetComponent<UpgradeCard>();
|
||||
upgradeCard.upgradeType = upgradeType;
|
||||
upgradeCard.upgradeLevel = currentLevel;
|
||||
upgradeCard.upgradeCost = upgradeCosts[upgradeType];
|
||||
upgradeCard.upgradeManager = this;
|
||||
upgradeCard.UpdateUpgradeUI();
|
||||
|
||||
// 1) Choose which prefab array to use
|
||||
GameObject prefab;
|
||||
if ((int)upgradeType < normalUpgradePrefabs.Length)
|
||||
{
|
||||
// It's one of FireRate=0, Range=1, Damage=2
|
||||
prefab = normalUpgradePrefabs[(int)upgradeType];
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's a special upgrade, e.g. MultiShot, Homing, Ricochet
|
||||
int specialIndex = (int)upgradeType - normalUpgradePrefabs.Length;
|
||||
// e.g. MultiShot=3 => specialIndex=0
|
||||
// Homing=4 => specialIndex=1, etc.
|
||||
prefab = specialUpgradePrefabs[specialIndex];
|
||||
}
|
||||
Button button = cardObject.GetComponent<Button>();
|
||||
button.onClick.AddListener(() => TryUpgrade(upgradeType));
|
||||
|
||||
// 2) Instantiate the correct prefab
|
||||
GameObject upgradeCardObj = Instantiate(prefab, spawnPosition, Quaternion.identity);
|
||||
|
||||
// 3) Set up the UpgradeCard component
|
||||
UpgradeCard upgradeCard = upgradeCardObj.GetComponentInChildren<UpgradeCard>();
|
||||
if (upgradeCard != null)
|
||||
{
|
||||
upgradeCard.upgradeType = upgradeType;
|
||||
upgradeCard.upgradeLevel = currentLevel;
|
||||
upgradeCard.upgradeCost = upgradeCosts[upgradeType];
|
||||
upgradeCard.upgradeManager = this;
|
||||
upgradeCard.upgradeText = upgradeCardObj.GetComponentInChildren<TextMeshProUGUI>(true);
|
||||
upgradeCard.UpdateUpgradeUI();
|
||||
}
|
||||
activeCards[upgradeType] = upgradeCard;
|
||||
UpdateCardAffordability(upgradeCard);
|
||||
}
|
||||
|
||||
public int GetBaseCost(UpgradeCard.UpgradeType type)
|
||||
@@ -110,14 +106,14 @@ public class UpgradeManager : MonoBehaviour
|
||||
|
||||
public void TryUpgrade(UpgradeCard.UpgradeType type)
|
||||
{
|
||||
if (bits >= upgradeCosts[type])
|
||||
{
|
||||
bits -= upgradeCosts[type];
|
||||
upgradeLevels[type]++;
|
||||
upgradeCosts[type] += (int)(upgradeCosts[type] * 0.5f);
|
||||
ApplyUpgrade(type);
|
||||
UpdateBitsText();
|
||||
}
|
||||
if (!upgradeCosts.ContainsKey(type) || bits < upgradeCosts[type])
|
||||
return;
|
||||
|
||||
bits -= upgradeCosts[type];
|
||||
upgradeLevels[type]++;
|
||||
upgradeCosts[type] += Mathf.Max(1, Mathf.RoundToInt(upgradeCosts[type] * 0.5f));
|
||||
ApplyUpgrade(type);
|
||||
UpdateBitsText();
|
||||
}
|
||||
|
||||
void ApplyUpgrade(UpgradeCard.UpgradeType type)
|
||||
@@ -149,92 +145,319 @@ public class UpgradeManager : MonoBehaviour
|
||||
|
||||
void UpdateUpgradeCards()
|
||||
{
|
||||
UpgradeCard[] allCards = FindObjectsOfType<UpgradeCard>();
|
||||
foreach (UpgradeCard card in allCards)
|
||||
foreach (UpgradeCard card in activeCards.Values)
|
||||
{
|
||||
card.upgradeLevel = upgradeLevels[card.upgradeType] + 1;
|
||||
card.upgradeCost = upgradeCosts[card.upgradeType];
|
||||
card.UpdateUpgradeUI();
|
||||
UpdateCardAffordability(card);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateBitsText()
|
||||
{
|
||||
if (bitsText != null)
|
||||
if (bitsText == null)
|
||||
return;
|
||||
|
||||
StyleBitsText();
|
||||
bitsText.text = "BITS " + bits;
|
||||
}
|
||||
|
||||
void StyleBitsText()
|
||||
{
|
||||
RectTransform rect = bitsText.GetComponent<RectTransform>();
|
||||
if (rect != null)
|
||||
{
|
||||
bitsText.text = "Bits: " + bits;
|
||||
rect.anchorMin = new Vector2(0f, 1f);
|
||||
rect.anchorMax = new Vector2(0f, 1f);
|
||||
rect.pivot = new Vector2(0f, 1f);
|
||||
rect.anchoredPosition = new Vector2(24f, -24f);
|
||||
rect.sizeDelta = new Vector2(150f, 42f);
|
||||
}
|
||||
|
||||
bitsText.alignment = TextAlignmentOptions.Center;
|
||||
bitsText.fontSize = 21f;
|
||||
bitsText.fontStyle = FontStyles.Bold;
|
||||
bitsText.color = new Color(0.98f, 0.87f, 0.32f, 1f);
|
||||
bitsText.raycastTarget = false;
|
||||
|
||||
Outline outline = bitsText.GetComponent<Outline>();
|
||||
if (outline == null)
|
||||
outline = bitsText.gameObject.AddComponent<Outline>();
|
||||
outline.effectColor = new Color(0f, 0f, 0f, 0.55f);
|
||||
outline.effectDistance = new Vector2(1.5f, -1.5f);
|
||||
}
|
||||
|
||||
public void ShowSpecialUpgradeChoice()
|
||||
{
|
||||
Debug.Log(specialUpgradeSpawnParent.name);
|
||||
Debug.Log("Showing Upgrades...");
|
||||
List<GameObject> available = new List<GameObject>(specialUpgradePrefabs);
|
||||
EnsureUpgradeDock();
|
||||
|
||||
List<UpgradeCard.UpgradeType> available = new List<UpgradeCard.UpgradeType>();
|
||||
foreach (UpgradeCard.UpgradeType type in SpecialUpgradeTypes)
|
||||
{
|
||||
if (!unlockedUpgrades.Contains(type))
|
||||
available.Add(type);
|
||||
}
|
||||
|
||||
if (available.Count == 0)
|
||||
return;
|
||||
|
||||
// Shuffle the list to randomize order (Fisher-Yates)
|
||||
for (int i = 0; i < available.Count; i++)
|
||||
{
|
||||
int rand = Random.Range(i, available.Count);
|
||||
var temp = available[i];
|
||||
int rand = UnityEngine.Random.Range(i, available.Count);
|
||||
UpgradeCard.UpgradeType temp = available[i];
|
||||
available[i] = available[rand];
|
||||
available[rand] = temp;
|
||||
}
|
||||
|
||||
// Determine how many upgrades we can actually show
|
||||
Time.timeScale = 0f;
|
||||
specialOverlay = CreateOverlay();
|
||||
RectTransform row = CreateRect("SpecialUpgradeRow", specialOverlay.transform);
|
||||
row.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
row.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
row.pivot = new Vector2(0.5f, 0.5f);
|
||||
row.sizeDelta = new Vector2(590f, 190f);
|
||||
|
||||
HorizontalLayoutGroup layout = row.gameObject.AddComponent<HorizontalLayoutGroup>();
|
||||
layout.spacing = 16f;
|
||||
layout.childAlignment = TextAnchor.MiddleCenter;
|
||||
layout.childControlWidth = true;
|
||||
layout.childControlHeight = true;
|
||||
layout.childForceExpandWidth = false;
|
||||
layout.childForceExpandHeight = false;
|
||||
|
||||
int numToShow = Mathf.Min(3, available.Count);
|
||||
|
||||
// If there are no upgrades left, resume game and return
|
||||
if (numToShow == 0)
|
||||
{
|
||||
Debug.Log("No special upgrades available!");
|
||||
Time.timeScale = 1f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Instantiate the first 'numToShow' from the shuffled list
|
||||
float startX = -specialUpgradeSpacing;
|
||||
for (int i = 0; i < numToShow; i++)
|
||||
{
|
||||
float xPos = startX + i * specialUpgradeSpacing;
|
||||
Vector3 spawnPos = specialUpgradeSpawnParent.position + new Vector3(xPos, 0, 0);
|
||||
UpgradeCard.UpgradeType type = available[i];
|
||||
GameObject cardObject = CreateUpgradeCardObject(type, row, true);
|
||||
UpgradeCard card = cardObject.GetComponent<UpgradeCard>();
|
||||
card.upgradeType = type;
|
||||
card.upgradeLevel = 1;
|
||||
card.upgradeCost = 0;
|
||||
card.upgradeManager = this;
|
||||
card.UpdateUpgradeUI();
|
||||
card.upgradeCostText.text = "UNLOCK";
|
||||
|
||||
GameObject specialCardObj =
|
||||
Instantiate(available[i], spawnPos, Quaternion.identity, specialUpgradeSpawnParent);
|
||||
Debug.Log("Spawned special card: " + specialCardObj, specialCardObj);
|
||||
// Add your click-to-choose script
|
||||
SpecialChoiceCard choiceCard = specialCardObj.AddComponent<SpecialChoiceCard>();
|
||||
choiceCard.upgradeManager = this;
|
||||
Button button = cardObject.GetComponent<Button>();
|
||||
button.onClick.AddListener(() => SelectSpecialUpgrade(type));
|
||||
}
|
||||
}
|
||||
|
||||
public void UnlockSpecialUpgrade(UpgradeCard.UpgradeType type)
|
||||
{
|
||||
Debug.Log("Card chosen! Applying upgrade...");
|
||||
// 1) Add this special upgrade type to the dictionary if not present
|
||||
if (!upgradeLevels.ContainsKey(type))
|
||||
{
|
||||
upgradeLevels[type] = 0;
|
||||
upgradeCosts[type] = GetBaseCost(type);
|
||||
}
|
||||
|
||||
// 2) Add to the “unlockedUpgrades” list if you want to track them
|
||||
if (!unlockedUpgrades.Contains(type))
|
||||
unlockedUpgrades.Add(type);
|
||||
|
||||
// 3) Instantiate it at the bottom row with the other upgrades
|
||||
float newXPos = CalculateNextUpgradeXPos(); // A method to place new card to the right
|
||||
SpawnUpgradeCard(type, newXPos);
|
||||
SpawnUpgradeCard(type, 0f);
|
||||
}
|
||||
|
||||
// Example method to find a new X position for the newly unlocked card
|
||||
float CalculateNextUpgradeXPos()
|
||||
void SelectSpecialUpgrade(UpgradeCard.UpgradeType type)
|
||||
{
|
||||
// If you originally placed normal upgrades from -X to +X,
|
||||
// find how many total upgrades are unlocked, and space them out.
|
||||
// For simplicity:
|
||||
int totalUnlocked = FindObjectsOfType<UpgradeCard>().Length;
|
||||
float spacing = 2.5f;
|
||||
return -((totalUnlocked - 1) * spacing / 2f) + (totalUnlocked - 1) * spacing;
|
||||
UnlockSpecialUpgrade(type);
|
||||
|
||||
if (specialOverlay != null)
|
||||
Destroy(specialOverlay);
|
||||
|
||||
specialOverlay = null;
|
||||
Time.timeScale = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
void EnsureUpgradeDock()
|
||||
{
|
||||
if (upgradeDock != null)
|
||||
return;
|
||||
|
||||
Canvas canvas = FindAnyObjectByType<Canvas>();
|
||||
if (canvas == null)
|
||||
{
|
||||
GameObject canvasObject = new GameObject("GameUI", typeof(RectTransform), typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster));
|
||||
canvas = canvasObject.GetComponent<Canvas>();
|
||||
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||
|
||||
CanvasScaler scaler = canvasObject.GetComponent<CanvasScaler>();
|
||||
scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
|
||||
scaler.referenceResolution = new Vector2(800f, 600f);
|
||||
scaler.matchWidthOrHeight = 0.5f;
|
||||
}
|
||||
|
||||
Transform existingDock = canvas.transform.Find("UpgradeDock");
|
||||
upgradeDock = existingDock != null ? existingDock.GetComponent<RectTransform>() : CreateRect("UpgradeDock", canvas.transform);
|
||||
upgradeDock.anchorMin = new Vector2(0f, 0f);
|
||||
upgradeDock.anchorMax = new Vector2(1f, 0f);
|
||||
upgradeDock.pivot = new Vector2(0.5f, 0f);
|
||||
upgradeDock.anchoredPosition = Vector2.zero;
|
||||
upgradeDock.sizeDelta = new Vector2(0f, 150f);
|
||||
upgradeDock.SetAsLastSibling();
|
||||
|
||||
Image dockImage = upgradeDock.GetComponent<Image>();
|
||||
if (dockImage == null)
|
||||
dockImage = upgradeDock.gameObject.AddComponent<Image>();
|
||||
dockImage.color = new Color(0.03f, 0.035f, 0.045f, 0.94f);
|
||||
dockImage.raycastTarget = true;
|
||||
|
||||
Transform existingRow = upgradeDock.Find("Cards");
|
||||
upgradeCardRow = existingRow != null ? existingRow.GetComponent<RectTransform>() : CreateRect("Cards", upgradeDock);
|
||||
upgradeCardRow.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
upgradeCardRow.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
upgradeCardRow.pivot = new Vector2(0.5f, 0.5f);
|
||||
upgradeCardRow.anchoredPosition = new Vector2(0f, 6f);
|
||||
upgradeCardRow.sizeDelta = new Vector2(720f, 126f);
|
||||
|
||||
HorizontalLayoutGroup layout = upgradeCardRow.GetComponent<HorizontalLayoutGroup>();
|
||||
if (layout == null)
|
||||
layout = upgradeCardRow.gameObject.AddComponent<HorizontalLayoutGroup>();
|
||||
layout.spacing = 12f;
|
||||
layout.childAlignment = TextAnchor.MiddleCenter;
|
||||
layout.childControlWidth = true;
|
||||
layout.childControlHeight = true;
|
||||
layout.childForceExpandWidth = false;
|
||||
layout.childForceExpandHeight = false;
|
||||
}
|
||||
|
||||
GameObject CreateUpgradeCardObject(UpgradeCard.UpgradeType type, Transform parent, bool specialChoice)
|
||||
{
|
||||
GameObject cardObject = new GameObject(type + "Card", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button), typeof(UpgradeCard));
|
||||
RectTransform cardRect = cardObject.GetComponent<RectTransform>();
|
||||
cardRect.SetParent(parent, false);
|
||||
|
||||
LayoutElement layout = cardObject.AddComponent<LayoutElement>();
|
||||
layout.preferredWidth = specialChoice ? 180f : 150f;
|
||||
layout.preferredHeight = specialChoice ? 180f : 116f;
|
||||
layout.minWidth = layout.preferredWidth;
|
||||
layout.minHeight = layout.preferredHeight;
|
||||
|
||||
Image image = cardObject.GetComponent<Image>();
|
||||
image.color = specialChoice ? new Color(0.11f, 0.12f, 0.16f, 0.98f) : new Color(0.1f, 0.11f, 0.14f, 0.98f);
|
||||
|
||||
Button button = cardObject.GetComponent<Button>();
|
||||
ColorBlock colors = button.colors;
|
||||
colors.normalColor = image.color;
|
||||
colors.highlightedColor = new Color(0.16f, 0.19f, 0.25f, 1f);
|
||||
colors.pressedColor = new Color(0.06f, 0.28f, 0.36f, 1f);
|
||||
colors.selectedColor = colors.highlightedColor;
|
||||
colors.disabledColor = new Color(0.08f, 0.08f, 0.09f, 0.78f);
|
||||
colors.colorMultiplier = 1f;
|
||||
button.colors = colors;
|
||||
|
||||
UpgradeCard card = cardObject.GetComponent<UpgradeCard>();
|
||||
card.upgradeText = CreateText("UpgradeText", cardRect, GetDisplayName(type), specialChoice ? 20f : 17f, FontStyles.Bold, TextAlignmentOptions.Center);
|
||||
card.upgradeDescription = CreateText("UpgradeDescription", cardRect, GetDescription(type), specialChoice ? 13f : 11f, FontStyles.Normal, TextAlignmentOptions.TopLeft);
|
||||
card.upgradeCostText = CreateText("UpgradeCost", cardRect, "", specialChoice ? 12f : 11f, FontStyles.Bold, TextAlignmentOptions.Center);
|
||||
|
||||
PlaceCardText(card.upgradeText.rectTransform, 10f, -8f, -10f, 28f, true);
|
||||
PlaceCardText(card.upgradeDescription.rectTransform, 12f, -40f, -12f, 44f, true);
|
||||
PlaceCardText(card.upgradeCostText.rectTransform, 10f, 8f, -10f, 22f, false);
|
||||
|
||||
return cardObject;
|
||||
}
|
||||
|
||||
GameObject CreateOverlay()
|
||||
{
|
||||
Canvas canvas = upgradeDock.GetComponentInParent<Canvas>();
|
||||
GameObject overlay = new GameObject("SpecialUpgradeOverlay", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
RectTransform rect = overlay.GetComponent<RectTransform>();
|
||||
rect.SetParent(canvas.transform, false);
|
||||
rect.anchorMin = Vector2.zero;
|
||||
rect.anchorMax = Vector2.one;
|
||||
rect.offsetMin = Vector2.zero;
|
||||
rect.offsetMax = Vector2.zero;
|
||||
rect.SetAsLastSibling();
|
||||
|
||||
Image image = overlay.GetComponent<Image>();
|
||||
image.color = new Color(0f, 0f, 0f, 0.74f);
|
||||
image.raycastTarget = true;
|
||||
|
||||
TextMeshProUGUI title = CreateText("Title", rect, "CHOOSE UPGRADE", 28f, FontStyles.Bold, TextAlignmentOptions.Center);
|
||||
RectTransform titleRect = title.rectTransform;
|
||||
titleRect.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
titleRect.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
titleRect.pivot = new Vector2(0.5f, 0.5f);
|
||||
titleRect.anchoredPosition = new Vector2(0f, 128f);
|
||||
titleRect.sizeDelta = new Vector2(420f, 42f);
|
||||
|
||||
return overlay;
|
||||
}
|
||||
|
||||
void UpdateCardAffordability(UpgradeCard card)
|
||||
{
|
||||
Button button = card.GetComponent<Button>();
|
||||
if (button != null)
|
||||
button.interactable = bits >= card.upgradeCost;
|
||||
|
||||
if (card.upgradeCostText != null)
|
||||
{
|
||||
card.upgradeCostText.color = bits >= card.upgradeCost
|
||||
? new Color(0.98f, 0.87f, 0.32f, 1f)
|
||||
: new Color(0.95f, 0.34f, 0.32f, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
static RectTransform CreateRect(string name, Transform parent)
|
||||
{
|
||||
GameObject obj = new GameObject(name, typeof(RectTransform));
|
||||
RectTransform rect = obj.GetComponent<RectTransform>();
|
||||
rect.SetParent(parent, false);
|
||||
return rect;
|
||||
}
|
||||
|
||||
static TextMeshProUGUI CreateText(string name, Transform parent, string text, float fontSize, FontStyles style, TextAlignmentOptions alignment)
|
||||
{
|
||||
GameObject obj = new GameObject(name, typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI));
|
||||
RectTransform rect = obj.GetComponent<RectTransform>();
|
||||
rect.SetParent(parent, false);
|
||||
|
||||
TextMeshProUGUI label = obj.GetComponent<TextMeshProUGUI>();
|
||||
label.text = text;
|
||||
label.fontSize = fontSize;
|
||||
label.fontStyle = style;
|
||||
label.alignment = alignment;
|
||||
label.color = new Color(0.9f, 0.93f, 0.98f, 1f);
|
||||
label.textWrappingMode = TextWrappingModes.Normal;
|
||||
label.raycastTarget = false;
|
||||
return label;
|
||||
}
|
||||
|
||||
static void PlaceCardText(RectTransform rect, float left, float top, float right, float height, bool fromTop)
|
||||
{
|
||||
rect.anchorMin = fromTop ? new Vector2(0f, 1f) : new Vector2(0f, 0f);
|
||||
rect.anchorMax = fromTop ? new Vector2(1f, 1f) : new Vector2(1f, 0f);
|
||||
rect.pivot = fromTop ? new Vector2(0.5f, 1f) : new Vector2(0.5f, 0f);
|
||||
rect.offsetMin = new Vector2(left, fromTop ? -height : top);
|
||||
rect.offsetMax = new Vector2(right, fromTop ? top : top + height);
|
||||
}
|
||||
|
||||
static string GetDisplayName(UpgradeCard.UpgradeType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case UpgradeCard.UpgradeType.FireRate: return "FIRE RATE";
|
||||
case UpgradeCard.UpgradeType.Range: return "RANGE";
|
||||
case UpgradeCard.UpgradeType.Damage: return "DAMAGE";
|
||||
case UpgradeCard.UpgradeType.MultiShot: return "MULTI SHOT";
|
||||
case UpgradeCard.UpgradeType.Homing: return "HOMING";
|
||||
case UpgradeCard.UpgradeType.Ricochet: return "RICOCHET";
|
||||
default: return type.ToString().ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
static string GetDescription(UpgradeCard.UpgradeType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case UpgradeCard.UpgradeType.FireRate: return "Shoot 10% faster.";
|
||||
case UpgradeCard.UpgradeType.Range: return "Increase targeting range.";
|
||||
case UpgradeCard.UpgradeType.Damage: return "Add 1 damage per bullet.";
|
||||
case UpgradeCard.UpgradeType.MultiShot: return "Fire one extra bullet.";
|
||||
case UpgradeCard.UpgradeType.Homing: return "Bullets track targets.";
|
||||
case UpgradeCard.UpgradeType.Ricochet: return "Shots can bounce onward.";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,8 @@ TextureImporter:
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
nameFileIdTable:
|
||||
UpgradeTemplate_0: -2231563604338320808
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
|
||||
@@ -15,7 +15,7 @@ Material:
|
||||
- _EMISSION
|
||||
- _NORMALMAP
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@@ -115,6 +115,7 @@ Material:
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 0.7137255}
|
||||
@@ -135,4 +136,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@@ -14,7 +14,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@@ -147,6 +147,7 @@ Material:
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -170,4 +171,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
+1
-1
@@ -154,4 +154,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@@ -29,7 +29,6 @@ MonoBehaviour:
|
||||
m_StripUnusedVariants: 1
|
||||
m_StripScreenCoordOverrideVariants: 1
|
||||
supportRuntimeDebugDisplay: 0
|
||||
m_EnableRenderGraph: 0
|
||||
m_Settings:
|
||||
m_SettingsList:
|
||||
m_List:
|
||||
@@ -55,9 +54,22 @@ MonoBehaviour:
|
||||
- rid: 7752762179098771475
|
||||
- rid: 7752762179098771476
|
||||
- rid: 3114554863623077888
|
||||
- rid: 803628147897270275
|
||||
- rid: 803628147897270276
|
||||
- rid: 803628147897270277
|
||||
- rid: 803628147897270278
|
||||
- rid: 803628147897270279
|
||||
- rid: 803628147897270280
|
||||
- rid: 803628147897270281
|
||||
- rid: 803628147897270282
|
||||
- rid: 803628147897270283
|
||||
- rid: 803628147897270284
|
||||
- rid: 803628147897270285
|
||||
- rid: 803628147897270286
|
||||
- rid: 803628147897270287
|
||||
m_RuntimeSettings:
|
||||
m_List: []
|
||||
m_AssetVersion: 8
|
||||
m_AssetVersion: 10
|
||||
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
||||
m_RenderingLayerNames:
|
||||
- Default
|
||||
@@ -80,6 +92,175 @@ MonoBehaviour:
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 803628147897270275
|
||||
type: {class: RayTracingRenderPipelineResources, ns: UnityEngine.Rendering.UnifiedRayTracing, asm: Unity.UnifiedRayTracing.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_GeometryPoolKernels: {fileID: 7200000, guid: 98e3d58cae7210c4786f67f504c9e899, type: 3}
|
||||
m_CopyBuffer: {fileID: 7200000, guid: 1b95b5dcf48d1914c9e1e7405c7660e3, type: 3}
|
||||
m_CopyPositions: {fileID: 7200000, guid: 1ad53a96b58d3c3488dde4f14db1aaeb, type: 3}
|
||||
m_BitHistogram: {fileID: 7200000, guid: 8670f7ce4b60cef43bed36148aa1b0a2, type: 3}
|
||||
m_BlockReducePart: {fileID: 7200000, guid: 4e034cc8ea2635c4e9f063e5ddc7ea7a, type: 3}
|
||||
m_BlockScan: {fileID: 7200000, guid: 4d6d5de35fa45ef4a92119397a045cc9, type: 3}
|
||||
m_BuildHlbvh: {fileID: 7200000, guid: 2d70cd6be91bd7843a39a54b51c15b13, type: 3}
|
||||
m_RestructureBvh: {fileID: 7200000, guid: 56641cb88dcb31a4398a4997ef7a7a8c, type: 3}
|
||||
m_Scatter: {fileID: 7200000, guid: a2eaeefdac4637a44b734e85b7be9186, type: 3}
|
||||
- rid: 803628147897270276
|
||||
type: {class: PostProcessData/ShaderResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
stopNanPS: {fileID: 4800000, guid: 1121bb4e615ca3c48b214e79e841e823, type: 3}
|
||||
subpixelMorphologicalAntialiasingPS: {fileID: 4800000, guid: 63eaba0ebfb82cc43bde059b4a8c65f6, type: 3}
|
||||
gaussianDepthOfFieldPS: {fileID: 4800000, guid: 5e7134d6e63e0bc47a1dd2669cedb379, type: 3}
|
||||
bokehDepthOfFieldPS: {fileID: 4800000, guid: 2aed67ad60045d54ba3a00c91e2d2631, type: 3}
|
||||
cameraMotionBlurPS: {fileID: 4800000, guid: 1edcd131364091c46a17cbff0b1de97a, type: 3}
|
||||
paniniProjectionPS: {fileID: 4800000, guid: a15b78cf8ca26ca4fb2090293153c62c, type: 3}
|
||||
lutBuilderLdrPS: {fileID: 4800000, guid: 65df88701913c224d95fc554db28381a, type: 3}
|
||||
lutBuilderHdrPS: {fileID: 4800000, guid: ec9fec698a3456d4fb18cf8bacb7a2bc, type: 3}
|
||||
bloomPS: {fileID: 4800000, guid: 5f1864addb451f54bae8c86d230f736e, type: 3}
|
||||
temporalAntialiasingPS: {fileID: 4800000, guid: 9c70c1a35ff15f340b38ea84842358bf, type: 3}
|
||||
LensFlareDataDrivenPS: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92, type: 3}
|
||||
LensFlareScreenSpacePS: {fileID: 4800000, guid: 701880fecb344ea4c9cd0db3407ab287, type: 3}
|
||||
scalingSetupPS: {fileID: 4800000, guid: e8ee25143a34b8c4388709ea947055d1, type: 3}
|
||||
easuPS: {fileID: 4800000, guid: 562b7ae4f629f144aa97780546fce7c6, type: 3}
|
||||
uberPostPS: {fileID: 4800000, guid: e7857e9d0c934dc4f83f270f8447b006, type: 3}
|
||||
finalPostPassPS: {fileID: 4800000, guid: c49e63ed1bbcb334780a3bd19dfed403, type: 3}
|
||||
m_ShaderResourcesVersion: 0
|
||||
- rid: 803628147897270277
|
||||
type: {class: PostProcessData/TextureResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
blueNoise16LTex:
|
||||
- {fileID: 2800000, guid: 81200413a40918d4d8702e94db29911c, type: 3}
|
||||
- {fileID: 2800000, guid: d50c5e07c9911a74982bddf7f3075e7b, type: 3}
|
||||
- {fileID: 2800000, guid: 1134690bf9216164dbc75050e35b7900, type: 3}
|
||||
- {fileID: 2800000, guid: 7ce2118f74614a94aa8a0cdf2e6062c3, type: 3}
|
||||
- {fileID: 2800000, guid: 2ca97df9d1801e84a8a8f2c53cb744f0, type: 3}
|
||||
- {fileID: 2800000, guid: e63eef8f54aa9dc4da9a5ac094b503b5, type: 3}
|
||||
- {fileID: 2800000, guid: 39451254daebd6d40b52899c1f1c0c1b, type: 3}
|
||||
- {fileID: 2800000, guid: c94ad916058dff743b0f1c969ddbe660, type: 3}
|
||||
- {fileID: 2800000, guid: ed5ea7ce59ca8ec4f9f14bf470a30f35, type: 3}
|
||||
- {fileID: 2800000, guid: 071e954febf155243a6c81e48f452644, type: 3}
|
||||
- {fileID: 2800000, guid: 96aaab9cc247d0b4c98132159688c1af, type: 3}
|
||||
- {fileID: 2800000, guid: fc3fa8f108657e14486697c9a84ccfc5, type: 3}
|
||||
- {fileID: 2800000, guid: bfed3e498947fcb4890b7f40f54d85b9, type: 3}
|
||||
- {fileID: 2800000, guid: d512512f4af60a442ab3458489412954, type: 3}
|
||||
- {fileID: 2800000, guid: 47a45908f6db0cb44a0d5e961143afec, type: 3}
|
||||
- {fileID: 2800000, guid: 4dcc0502f8586f941b5c4a66717205e8, type: 3}
|
||||
- {fileID: 2800000, guid: 9d92991794bb5864c8085468b97aa067, type: 3}
|
||||
- {fileID: 2800000, guid: 14381521ff11cb74abe3fe65401c23be, type: 3}
|
||||
- {fileID: 2800000, guid: d36f0fe53425e08499a2333cf423634c, type: 3}
|
||||
- {fileID: 2800000, guid: d4044ea2490d63b43aa1765f8efbf8a9, type: 3}
|
||||
- {fileID: 2800000, guid: c9bd74624d8070f429e3f46d161f9204, type: 3}
|
||||
- {fileID: 2800000, guid: d5c9b274310e5524ebe32a4e4da3df1f, type: 3}
|
||||
- {fileID: 2800000, guid: f69770e54f2823f43badf77916acad83, type: 3}
|
||||
- {fileID: 2800000, guid: 10b6c6d22e73dea46a8ab36b6eebd629, type: 3}
|
||||
- {fileID: 2800000, guid: a2ec5cbf5a9b64345ad3fab0912ddf7b, type: 3}
|
||||
- {fileID: 2800000, guid: 1c3c6d69a645b804fa232004b96b7ad3, type: 3}
|
||||
- {fileID: 2800000, guid: d18a24d7b4ed50f4387993566d9d3ae2, type: 3}
|
||||
- {fileID: 2800000, guid: c989e1ed85cf7154caa922fec53e6af6, type: 3}
|
||||
- {fileID: 2800000, guid: ff47e5a0f105eb34883b973e51f4db62, type: 3}
|
||||
- {fileID: 2800000, guid: fa042edbfc40fbd4bad0ab9d505b1223, type: 3}
|
||||
- {fileID: 2800000, guid: 896d9004736809c4fb5973b7c12eb8b9, type: 3}
|
||||
- {fileID: 2800000, guid: 179f794063d2a66478e6e726f84a65bc, type: 3}
|
||||
filmGrainTex:
|
||||
- {fileID: 2800000, guid: 654c582f7f8a5a14dbd7d119cbde215d, type: 3}
|
||||
- {fileID: 2800000, guid: dd77ffd079630404e879388999033049, type: 3}
|
||||
- {fileID: 2800000, guid: 1097e90e1306e26439701489f391a6c0, type: 3}
|
||||
- {fileID: 2800000, guid: f0b67500f7fad3b4c9f2b13e8f41ba6e, type: 3}
|
||||
- {fileID: 2800000, guid: 9930fb4528622b34687b00bbe6883de7, type: 3}
|
||||
- {fileID: 2800000, guid: bd9e8c758250ef449a4b4bfaad7a2133, type: 3}
|
||||
- {fileID: 2800000, guid: 510a2f57334933e4a8dbabe4c30204e4, type: 3}
|
||||
- {fileID: 2800000, guid: b4db8180660810945bf8d55ab44352ad, type: 3}
|
||||
- {fileID: 2800000, guid: fd2fd78b392986e42a12df2177d3b89c, type: 3}
|
||||
- {fileID: 2800000, guid: 5cdee82a77d13994f83b8fdabed7c301, type: 3}
|
||||
smaaAreaTex: {fileID: 2800000, guid: d1f1048909d55cd4fa1126ab998f617e, type: 3}
|
||||
smaaSearchTex: {fileID: 2800000, guid: 51eee22c2a633ef4aada830eed57c3fd, type: 3}
|
||||
m_TexturesResourcesVersion: 0
|
||||
- rid: 803628147897270278
|
||||
type: {class: OnTilePostProcessResource, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_UberPostShader: {fileID: 4800000, guid: fe4f13c1004a07d4ea1e30bfd0326d9e, type: 3}
|
||||
- rid: 803628147897270279
|
||||
type: {class: UniversalRenderPipelineRuntimeTerrainShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
|
||||
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
|
||||
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
|
||||
- rid: 803628147897270280
|
||||
type: {class: URPReflectionProbeSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
version: 1
|
||||
useReflectionProbeRotation: 0
|
||||
- rid: 803628147897270281
|
||||
type: {class: ScreenSpaceAmbientOcclusionDynamicResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_BlueNoise256Textures:
|
||||
- {fileID: 2800000, guid: 36f118343fc974119bee3d09e2111500, type: 3}
|
||||
- {fileID: 2800000, guid: 4b7b083e6b6734e8bb2838b0b50a0bc8, type: 3}
|
||||
- {fileID: 2800000, guid: c06cc21c692f94f5fb5206247191eeee, type: 3}
|
||||
- {fileID: 2800000, guid: cb76dd40fa7654f9587f6a344f125c9a, type: 3}
|
||||
- {fileID: 2800000, guid: e32226222ff144b24bf3a5a451de54bc, type: 3}
|
||||
- {fileID: 2800000, guid: 3302065f671a8450b82c9ddf07426f3a, type: 3}
|
||||
- {fileID: 2800000, guid: 56a77a3e8d64f47b6afe9e3c95cb57d5, type: 3}
|
||||
m_Version: 0
|
||||
- rid: 803628147897270282
|
||||
type: {class: ScreenSpaceAmbientOcclusionPersistentResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}
|
||||
m_Version: 0
|
||||
- rid: 803628147897270283
|
||||
type: {class: URPTerrainShaderSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_IncludeTerrainShaders: 1
|
||||
- rid: 803628147897270284
|
||||
type: {class: VrsRenderPipelineRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_TextureComputeShader: {fileID: 7200000, guid: cacb30de6c40c7444bbc78cb0a81fd2a, type: 3}
|
||||
m_VisualizationShader: {fileID: 4800000, guid: 620b55b8040a88d468e94abe55bed5ba, type: 3}
|
||||
m_VisualizationLookupTable:
|
||||
m_Data:
|
||||
- {r: 0.785, g: 0.23, b: 0.2, a: 1}
|
||||
- {r: 1, g: 0.8, b: 0.8, a: 1}
|
||||
- {r: 0.4, g: 0.2, b: 0.2, a: 1}
|
||||
- {r: 0.51, g: 0.8, b: 0.6, a: 1}
|
||||
- {r: 0.6, g: 0.8, b: 1, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.6, a: 1}
|
||||
- {r: 0.8, g: 1, b: 0.8, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.2, a: 1}
|
||||
- {r: 0.125, g: 0.22, b: 0.36, a: 1}
|
||||
m_ConversionLookupTable:
|
||||
m_Data:
|
||||
- {r: 0.785, g: 0.23, b: 0.2, a: 1}
|
||||
- {r: 1, g: 0.8, b: 0.8, a: 1}
|
||||
- {r: 0.4, g: 0.2, b: 0.2, a: 1}
|
||||
- {r: 0.51, g: 0.8, b: 0.6, a: 1}
|
||||
- {r: 0.6, g: 0.8, b: 1, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.6, a: 1}
|
||||
- {r: 0.8, g: 1, b: 0.8, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.2, a: 1}
|
||||
- {r: 0.125, g: 0.22, b: 0.36, a: 1}
|
||||
- rid: 803628147897270285
|
||||
type: {class: RenderingDebuggerRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_version: 0
|
||||
- rid: 803628147897270286
|
||||
type: {class: LightmapSamplingSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_UseBicubicLightmapSampling: 0
|
||||
- rid: 803628147897270287
|
||||
type: {class: WorldRenderPipelineResources, ns: UnityEngine.PathTracing.Core, asm: Unity.PathTracing.Runtime}
|
||||
data:
|
||||
_version: 3
|
||||
_blitCubemap: {fileID: 7200000, guid: 5a992812cb320d146a66cc600200cce7, type: 3}
|
||||
_blitGrayScaleCookie: {fileID: 7200000, guid: 557fa399e33bf7647bda5697c5c158df, type: 3}
|
||||
_setAlphaChannelShader: {fileID: 7200000, guid: 5efaea0e81c66334aa9d062d6573e6fd, type: 3}
|
||||
_environmentImportanceSamplingBuild: {fileID: 7200000, guid: 5bb2534d2411d344cbc54f880232640f, type: 3}
|
||||
_skyBoxMesh: {fileID: 4300000, guid: 0529e6c5f6dea8c4a8c2835ed7de57cb, type: 2}
|
||||
_sixFaceSkyBoxMesh: {fileID: 4300000, guid: a80925ceebd011741b42509226cefc74, type: 2}
|
||||
_buildLightGridShader: {fileID: 7200000, guid: 16e47c1641bd0104e92b624601457bb0, type: 3}
|
||||
- rid: 3114554863623077888
|
||||
type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
@@ -101,20 +282,17 @@ MonoBehaviour:
|
||||
m_SpriteUnshadowShader: {fileID: 4800000, guid: de02b375720b5c445afe83cd483bedf3, type: 3}
|
||||
m_GeometryShadowShader: {fileID: 4800000, guid: 19349a0f9a7ed4c48a27445bcf92e5e1, type: 3}
|
||||
m_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3}
|
||||
m_FallOffLookup: {fileID: 2800000, guid: 5688ab254e4c0634f8d6c8e0792331ca, type: 3}
|
||||
m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
|
||||
m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2}
|
||||
m_DefaultMesh2DLitMaterial: {fileID: 2100000, guid: 9452ae1262a74094f8a68013fbcd1834, type: 2}
|
||||
- rid: 7752762179098771458
|
||||
type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3}
|
||||
m_AutodeskInteractiveTransparent: {fileID: 4800000, guid: 5c81372d981403744adbdda4433c9c11, type: 3}
|
||||
m_AutodeskInteractiveMasked: {fileID: 4800000, guid: 80aa867ac363ac043847b06ad71604cd, type: 3}
|
||||
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
|
||||
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
|
||||
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
|
||||
m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3}
|
||||
m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3}
|
||||
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3}
|
||||
@@ -134,7 +312,6 @@ MonoBehaviour:
|
||||
type: {class: RenderGraphSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_EnableRenderCompatibilityMode: 0
|
||||
- rid: 7752762179098771462
|
||||
type: {class: UniversalRenderPipelineDebugShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
@@ -148,6 +325,8 @@ MonoBehaviour:
|
||||
m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
|
||||
m_CameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3}
|
||||
m_StencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3}
|
||||
m_ClusterDeferred: {fileID: 4800000, guid: 222cce62363a44a380c36bf03b392608, type: 3}
|
||||
m_StencilDitherMaskSeedPS: {fileID: 4800000, guid: 8c3ee818f2efa514c889881ccb2e95a2, type: 3}
|
||||
m_DBufferClear: {fileID: 4800000, guid: f056d8bd2a1c7e44e9729144b4c70395, type: 3}
|
||||
- rid: 7752762179098771464
|
||||
type: {class: UniversalRenderPipelineRuntimeXRResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
@@ -173,9 +352,9 @@ MonoBehaviour:
|
||||
m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
|
||||
m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
|
||||
m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
|
||||
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
|
||||
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
|
||||
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
|
||||
m_TerrainDetailLit: {fileID: 0}
|
||||
m_TerrainDetailGrassBillboard: {fileID: 0}
|
||||
m_TerrainDetailGrass: {fileID: 0}
|
||||
- rid: 7752762179098771467
|
||||
type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime}
|
||||
data:
|
||||
|
||||
Reference in New Issue
Block a user