Fix icons & add overlay support
This commit is contained in:
@@ -255,6 +255,142 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 72292951}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &83812369
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 83812370}
|
||||
- component: {fileID: 83812372}
|
||||
- component: {fileID: 83812371}
|
||||
m_Layer: 5
|
||||
m_Name: FPSCounter
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &83812370
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83812369}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1811565639}
|
||||
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: -432, y: 335}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &83812371
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83812369}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text:
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 4fd546dd0900395408d2de20f5025882, type: 2}
|
||||
m_sharedMaterial: {fileID: -1476194838487357290, guid: 4fd546dd0900395408d2de20f5025882, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 1358954495
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 0.3137255}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!222 &83812372
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83812369}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &302151016
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -484,6 +620,93 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 432923589}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &450099079
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 450099080}
|
||||
- component: {fileID: 450099081}
|
||||
m_Layer: 0
|
||||
m_Name: Overlay
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &450099080
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 450099079}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.32, y: 0.453, z: 0}
|
||||
m_LocalScale: {x: 1.2, y: 1.2, z: 1.2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 808236451}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &450099081
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 450099079}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 1
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1.28, y: 1.28}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 0
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &497996345
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -770,7 +993,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: e438446dc0ab8b6419c6cb63e0e72487, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spawnRate: 1
|
||||
scoreText: {fileID: 432923591}
|
||||
highScoreText: {fileID: 1606868532}
|
||||
boostText: {fileID: 497996347}
|
||||
@@ -778,8 +1000,8 @@ MonoBehaviour:
|
||||
pausePanel: {fileID: 302151016}
|
||||
rb: {fileID: 808236449}
|
||||
backgroundMusic: {fileID: 1625416039}
|
||||
fpsCounter: {fileID: 0}
|
||||
overlayRender: {fileID: 0}
|
||||
fpsCounter: {fileID: 83812371}
|
||||
overlayRender: {fileID: 450099081}
|
||||
--- !u!1 &527090675
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1149,7 +1371,8 @@ Transform:
|
||||
m_LocalPosition: {x: 0, y: -4.1359, z: 0}
|
||||
m_LocalScale: {x: 1.35, y: 1.35, z: 1.35}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 450099080}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1035262210
|
||||
@@ -1715,6 +1938,7 @@ RectTransform:
|
||||
- {fileID: 1606868531}
|
||||
- {fileID: 497996346}
|
||||
- {fileID: 302151017}
|
||||
- {fileID: 83812370}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
|
||||
@@ -3,14 +3,14 @@ using UnityEngine;
|
||||
|
||||
public class Game : MonoBehaviour
|
||||
{
|
||||
float spawnRate = 1f;
|
||||
float nextSpawnTime;
|
||||
int score;
|
||||
int highscore;
|
||||
float boostLeft;
|
||||
float slownessLeft;
|
||||
float screenWidth;
|
||||
bool isGrounded;
|
||||
private readonly float spawnRate = 1f;
|
||||
private float nextSpawnTime;
|
||||
private int score;
|
||||
private int highscore;
|
||||
private float boostLeft;
|
||||
private float slownessLeft;
|
||||
private float screenWidth;
|
||||
private bool isGrounded;
|
||||
public TMP_Text scoreText;
|
||||
public TMP_Text highScoreText;
|
||||
public TMP_Text boostText;
|
||||
@@ -18,10 +18,10 @@ public class Game : MonoBehaviour
|
||||
public GameObject pausePanel;
|
||||
public Rigidbody2D rb;
|
||||
public AudioSource backgroundMusic;
|
||||
//public TMP_Text fpsCounter;
|
||||
float nextUpdate;
|
||||
float fps;
|
||||
//public SpriteRenderer overlayRender;
|
||||
public TMP_Text fpsCounter;
|
||||
private float nextUpdate;
|
||||
private float fps;
|
||||
public SpriteRenderer overlayRender;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -34,64 +34,64 @@ public class Game : MonoBehaviour
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
SpriteRenderer component = bird.GetComponent<SpriteRenderer>();
|
||||
int num = PlayerPrefs.GetInt("icon", 1);
|
||||
int num2 = PlayerPrefs.GetInt("overlay", 1);
|
||||
int num2 = PlayerPrefs.GetInt("overlay", 0);
|
||||
if (num == 1)
|
||||
{
|
||||
if (PlayerPrefs.GetInt("userID", 0) == 1)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_-1");
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-1");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 2)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_-2");
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-2");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 4)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_-3");
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-3");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 6)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_-4");
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-4");
|
||||
}
|
||||
else
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_1");
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_1");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_" + num);
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + num);
|
||||
}
|
||||
if (num2 == 8)
|
||||
{
|
||||
//overlayRender.sprite = Resources.Load<Sprite>("icons/overlays/overlay_8");
|
||||
//overlayRender.transform.localPosition = new Vector3(-0.35f, 0.3f, 0f);
|
||||
overlayRender.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_8");
|
||||
overlayRender.transform.localPosition = new Vector3(-0.37f, 0.32f, 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//overlayRender.sprite = Resources.Load<Sprite>("icons/overlays/overlay_" + num2);
|
||||
overlayRender.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_" + num2);
|
||||
}
|
||||
if (component.sprite == null)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("icons/icons/bird_1");
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_1");
|
||||
PlayerPrefs.SetInt("icon", 1);
|
||||
}
|
||||
//if (overlayRender.sprite == null && num2 != 0)
|
||||
//{
|
||||
//overlayRender.sprite = Resources.Load<Sprite>("icons/overlays/overlay_1");
|
||||
//PlayerPrefs.SetInt("overlay", 1);
|
||||
//}
|
||||
if (overlayRender.sprite == null && num2 != 0)
|
||||
{
|
||||
overlayRender.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_1");
|
||||
PlayerPrefs.SetInt("overlay", 1);
|
||||
}
|
||||
PlayerPrefs.Save();
|
||||
backgroundMusic.volume = PlayerPrefs.GetFloat("musicVolume", 1f);
|
||||
screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect;
|
||||
GameObject.Find("HighScoreText").GetComponent<TMP_Text>().text = $"High Score: {highscore}";
|
||||
if (PlayerPrefs.GetInt("Setting2", 0) == 1)
|
||||
{
|
||||
GameObject leftArrow = new GameObject("LeftArrow");
|
||||
GameObject rightArrow = new GameObject("RightArrow");
|
||||
GameObject jumpArrow = new GameObject("JumpArrow");
|
||||
GameObject restartButton = new GameObject("RestartButton");
|
||||
GameObject backButton = new GameObject("BackButton");
|
||||
GameObject leftArrow = new("LeftArrow");
|
||||
GameObject rightArrow = new("RightArrow");
|
||||
GameObject jumpArrow = new("JumpArrow");
|
||||
GameObject restartButton = new("RestartButton");
|
||||
GameObject backButton = new("BackButton");
|
||||
leftArrow.AddComponent<SpriteRenderer>();
|
||||
rightArrow.AddComponent<SpriteRenderer>();
|
||||
jumpArrow.AddComponent<SpriteRenderer>();
|
||||
@@ -366,7 +366,7 @@ public class Game : MonoBehaviour
|
||||
if (PlayerPrefs.GetInt("Setting4", 0) == 1 && Time.time > nextUpdate)
|
||||
{
|
||||
fps = 1f / Time.deltaTime;
|
||||
//fpsCounter.text = "FPS: " + Mathf.Round(fps);
|
||||
fpsCounter.text = "FPS: " + Mathf.Round(fps);
|
||||
nextUpdate = Time.time + 0.25f;
|
||||
}
|
||||
if (screenWidth != Camera.main.orthographicSize * 2f * Camera.main.aspect)
|
||||
@@ -572,9 +572,9 @@ public class Game : MonoBehaviour
|
||||
|
||||
rb.gravityScale = (isGrounded ? 0f : 1.5f);
|
||||
|
||||
if (bird.transform.position.y < -4.18f)
|
||||
if (bird.transform.position.y < -4.1359f)
|
||||
{
|
||||
bird.transform.position = new Vector2(bird.transform.position.x, -4.18f);
|
||||
bird.transform.position = new Vector2(bird.transform.position.x, -4.1359f);
|
||||
rb.linearVelocity = new Vector2(rb.linearVelocity.x, 0f);
|
||||
}
|
||||
if (jumpArrow != null && jumpArrow.GetComponent<Renderer>() != null)
|
||||
|
||||
@@ -141,8 +141,7 @@ PlayerSettings:
|
||||
visionOSBundleVersion: 1.0
|
||||
tvOSBundleVersion: 1.0
|
||||
bundleVersion: 1.34
|
||||
preloadedAssets:
|
||||
- {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
||||
Reference in New Issue
Block a user