1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-29 10:24:18 +00:00
beat-td/Assets/Scripts/DepthFromY.cs

18 lines
406 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DepthFromY : MonoBehaviour {
private SpriteRenderer spriteRenderer;
void Start () {
spriteRenderer = gameObject.GetComponent<SpriteRenderer>();
spriteRenderer.sortingOrder = Mathf.CeilToInt(-transform.position.y * 100);
}
// Update is called once per frame
void Update () {
}
}