using System.Collections; using System.Collections.Generic; using UnityEngine; [ExecuteInEditMode] public class IsoObject : MonoBehaviour { public Camera IsoCamera; public List<MeshRenderer> IsoMeshes; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void LateUpdate() { Vector3 viewPos = IsoCamera.WorldToViewportPoint(gameObject.transform.position); foreach (MeshRenderer mr in IsoMeshes) { mr.material.SetVector("_CenterPoint", new Vector4(viewPos.x, viewPos.y)); } } }