mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-22 15:24:18 +00:00
14 lines
346 B
C#
14 lines
346 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DepthFromY : MonoBehaviour {
|
|
|
|
private SpriteRenderer spriteRenderer;
|
|
|
|
void Update () {
|
|
spriteRenderer = gameObject.GetComponent<SpriteRenderer>();
|
|
spriteRenderer.sortingOrder = Mathf.CeilToInt(-transform.position.y * 100);
|
|
}
|
|
|
|
}
|