Commit b179b448 authored by Luke Smith's avatar Luke Smith
Browse files

Organized Folders

parent b251d2b3
using UnityEngine;
using System.Collections;
public class ZSort : MonoBehaviour {
private SpriteRenderer sr;
public float offset = 0;
void Start () {
sr = GetComponent<SpriteRenderer>();
if (sr) {
sr.sortingLayerName = "Moving";
offset += sr.sprite.bounds.extents.y;
}
}
void LateUpdate () {
if (sr) {
sr.sortingOrder = (int)((transform.position.y - offset) * -100);
}
}
}
fileFormatVersion: 2
guid: b087211a03739c44b8dd007f71f5a81d
timeCreated: 1478222920
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment