Files
Keep-It-Alive/Assets/Scripts/GameObjects/Tree.cs
2020-04-18 18:14:51 +10:00

13 lines
308 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tree : MonoBehaviour {
SpriteRenderer spriteRenderer;
void Awake() {
spriteRenderer = GetComponent<SpriteRenderer>();
spriteRenderer.sortingOrder = -(int)Mathf.Floor(transform.localPosition.y * 100);
}
}