public void OnBeforeSerialize() { if (Camera == null) { Camera = GetComponent <Camera>(); } PixelCamera = PixelCamera ?? GetComponent <PixelCamera>(); }
//Loop ------------------------------------------------------------------------------- void Awake() { if (_inst != null && _inst != this) { Destroy(this.gameObject); return; } _inst = this; MyCamera = gameObject.GetComponent <Camera>(); CameraInicialSetting(); }
public override void OnInspectorGUI() { DrawDefaultInspector(); if (GUILayout.Button("Generate")) { pixelCamera = (PixelCamera)target; RemoveExistingPixelCameraItems(); CreatePixelCameraItems(); } }
void OnEnable() { instance = this; targetResolution = Screen.height; //if (targetResolution >= 1080) //{ // PPUScale = 1; //} //else // PPUScale = 2; if (isPixelPerfect == true) { SetPixelCamSize(); } }
void Start() { cam = GetComponentInChildren <PixelCamera>(); if (!cam) { isCam = false; } cam = FindObjectOfType <PixelCamera>(); if (transform.childCount > 0) { child = transform.GetChild(0); } d = 1f / cam.pixelsPerUnit; }
public override void _Ready() { Instance = this; }
void Start() { cam = GetComponentInChildren <PixelCamera>(); d = 1f / cam.pixelsPerUnit; }