Created
November 16, 2017 23:53
-
-
Save pacoelayudante/ddaff17375ef28c9438c7044265c9afe to your computer and use it in GitHub Desktop.
Cambiar el sorting mode de la Camara de Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class CamSort : MonoBehaviour { | |
public TransparencySortMode sortMode = TransparencySortMode.Orthographic; | |
void OnValidate() | |
{ | |
GetComponent<Camera>().transparencySortMode = sortMode; | |
} | |
void Start () { | |
GetComponent<Camera>().transparencySortMode = sortMode; | |
} | |
#if UNITY_EDITOR | |
[ContextMenu("Setear")] | |
public void Setear() | |
{ | |
GetComponent<Camera>().transparencySortMode = sortMode; | |
} | |
[ContextMenu("Alinear SceneCam")] | |
public void SceneCam() | |
{ | |
UnityEditor.SceneView.lastActiveSceneView.pivot = transform.position; | |
UnityEditor.SceneView.lastActiveSceneView.rotation = transform.rotation; | |
UnityEditor.SceneView.lastActiveSceneView.size = GetComponent<Camera>().fieldOfView; | |
UnityEditor.SceneView.lastActiveSceneView.Repaint(); | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment