This commit is contained in:
RochesterX
2025-04-16 19:57:54 -04:00
parent 5dee952cad
commit 6b7dbea593
2474 changed files with 244001 additions and 14116 deletions

View File

@@ -1,7 +1,8 @@
using System.Collections;
using NUnit.Framework.Constraints;
using UnityEngine;
using UnityEngine; using Game; using Music; using Player;
namespace Game{
public class DayNightCycle : MonoBehaviour
{
public SpriteRenderer daySky, eveningSky, nightSky;
@@ -97,3 +98,4 @@ public class DayNightCycle : MonoBehaviour
}
}
}
}

View File

@@ -1,44 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class ParallaxBackground : MonoBehaviour
{
public ParallaxCamera parallaxCamera;
List<ParallaxLayer> parallaxLayers = new List<ParallaxLayer>();
void Start()
{
if (parallaxCamera == null)
parallaxCamera = Camera.main.GetComponent<ParallaxCamera>();
if (parallaxCamera != null)
parallaxCamera.onCameraTranslate += Move;
SetLayers();
}
void SetLayers()
{
parallaxLayers.Clear();
for (int i = 0; i < transform.childCount; i++)
{
ParallaxLayer layer = transform.GetChild(i).GetComponent<ParallaxLayer>();
if (layer != null)
{
layer.name = "Layer-" + i;
parallaxLayers.Add(layer);
}
}
}
void Move(float delta)
{
foreach (ParallaxLayer layer in parallaxLayers)
{
layer.Move(delta);
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 0bdf61cebccfdae4eb5dfde2875a6b45

View File

@@ -1,29 +0,0 @@
using UnityEngine;
[ExecuteInEditMode]
public class ParallaxCamera : MonoBehaviour
{
public delegate void ParallaxCameraDelegate(float deltaMovement);
public ParallaxCameraDelegate onCameraTranslate;
private float oldPosition;
void Start()
{
oldPosition = transform.position.x;
}
void Update()
{
if (transform.position.x != oldPosition)
{
if (onCameraTranslate != null)
{
float delta = oldPosition - transform.position.x;
onCameraTranslate(delta);
}
oldPosition = transform.position.x;
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: f2ee5d10b5d7770438ac142d5edd40cc

View File

@@ -1,16 +0,0 @@
using UnityEngine;
[ExecuteInEditMode]
public class ParallaxLayer : MonoBehaviour
{
public float parallaxFactor;
public void Move(float delta)
{
Vector3 newPos = transform.localPosition;
newPos.x -= delta * parallaxFactor;
transform.localPosition = newPos;
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 711236ff0a3afd24caf53183a6c5c14c