Exemplo n.º 1
0
 public void OnBeforeSerialize()
 {
     if (Camera == null)
     {
         Camera = GetComponent <Camera>();
     }
     PixelCamera = PixelCamera ?? GetComponent <PixelCamera>();
 }
Exemplo n.º 2
0
    //Loop -------------------------------------------------------------------------------

    void Awake()
    {
        if (_inst != null && _inst != this)
        {
            Destroy(this.gameObject);
            return;
        }
        _inst = this;

        MyCamera = gameObject.GetComponent <Camera>();
        CameraInicialSetting();
    }
Exemplo n.º 3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (GUILayout.Button("Generate"))
        {
            pixelCamera = (PixelCamera)target;

            RemoveExistingPixelCameraItems();

            CreatePixelCameraItems();
        }
    }
Exemplo n.º 4
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (GUILayout.Button("Generate"))
        {
            pixelCamera = (PixelCamera)target;

            RemoveExistingPixelCameraItems();

            CreatePixelCameraItems();
        }
    }
Exemplo n.º 5
0
    void OnEnable()
    {
        instance = this;


        targetResolution = Screen.height;
        //if (targetResolution >= 1080)
        //{
        //    PPUScale = 1;
        //}
        //else
        //    PPUScale = 2;

        if (isPixelPerfect == true)
        {
            SetPixelCamSize();
        }
    }
Exemplo n.º 6
0
    void Start()
    {
        cam = GetComponentInChildren <PixelCamera>();

        if (!cam)
        {
            isCam = false;
        }

        cam = FindObjectOfType <PixelCamera>();

        if (transform.childCount > 0)
        {
            child = transform.GetChild(0);
        }

        d = 1f / cam.pixelsPerUnit;
    }
Exemplo n.º 7
0
 public override void _Ready()
 {
     Instance = this;
 }
Exemplo n.º 8
0
    void Start()
    {
        cam = GetComponentInChildren <PixelCamera>();

        d = 1f / cam.pixelsPerUnit;
    }