// Use this for initialization

    public void Init()

    {

        // Position Remember

        Screen_Size = new Vector2(this.GetComponent<RectTransform>().sizeDelta.x, this.GetComponent<RectTransform>().sizeDelta.y);

        Position_Transform = new Vector2(this.GetComponent<RectTransform>().anchoredPosition.x, this.GetComponent<RectTransform>().anchoredPosition.y);

        Earth_Rotate = new Vector3(0.0f, 0.0f, 0.5f);


        // Detecting memory leak

        ExceptionManager.Process_Test("SizeManager->Screen_Size");

        ExceptionManager.Process_Test("SizeManager->Position_Transform");

    }


    // Use this for initialization

    public void Resize_Transform()

    {

        // 1080 * 1920 (9:16) is basic setting

        // Processing

        this.GetComponent<RectTransform>().sizeDelta = new Vector2((Screen.width * Screen_Size.y) / 1080, (Screen.width * Screen_Size.y) / 1080);


        this.GetComponent<RectTransform>().anchoredPosition = new Vector2((Screen.width * Position_Transform.x) / 1080, (Screen.height * Position_Transform.y) / 1920);

        this.gameObject.SetActive(true);


        // Detecting memory leak

        ExceptionManager.Process_Test("SizeManager->sizeDelta");

        ExceptionManager.Process_Test("SizeManager->anchoredPosition");

    }


이미지 크기에 따른 크기 제조정 함수 구현


Posted by Leyhara
,