Newer
Older
fall / FallUnity / Assets / IsoSorting / IsoSprite.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[SelectionBase]
public class IsoSprite : MonoBehaviour {
    internal Vector3 CameraSpace;
    public GameObject Mesh;
    public bool IsoPerspective = false;
    void Start()
    {
        IsoHandler iso = GameObject.FindObjectOfType<IsoHandler>();
        iso.AddIsoSprite(this);
        if (IsoPerspective)
        {
            GameObject world = GameObject.Find("IsoWorld");
            Mesh.transform.parent = world.transform;
            Mesh.transform.localRotation = Quaternion.identity;
        }
    }
    
    void Destroy()
    {
        IsoHandler iso = GameObject.FindObjectOfType<IsoHandler>();
        iso.RemoveIsoSprite(this);
    }

    // Update is called once per frame
    void Update () {
		
	}
}