Example #1
0
    void Update()
    {
        MadTransform.SetLocalScale(drawCall.transform, transform.lossyScale);

        drawCall.transform.position = transform.position;
        drawCall.transform.rotation = transform.rotation;

        drawCall.gameObject.layer = gameObject.layer;
    }
Example #2
0
    void Update()
    {
        for (int i = 0; i < drawCalls.Count; i++)
        {
            var drawCall = drawCalls[i];

            MadTransform.SetLocalScale(drawCall.transform, transform.lossyScale);

            drawCall.transform.position = transform.position;
            drawCall.transform.rotation = transform.rotation;

            drawCall.gameObject.layer = gameObject.layer;
        }
    }
Example #3
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    void OnEnable()
    {
        if (drawCall == null)
        {
            drawCall = MadDrawCall.Create();
            drawCall.gameObject.layer = gameObject.layer;

            MadTransform.SetLocalScale(drawCall.transform, transform.lossyScale);
        }

        panel = GetComponent <MadPanel>();

        if (drawCall != null)
        {
            MadGameObject.SetActive(drawCall.gameObject, true);
        }
    }
Example #4
0
    private MadDrawCall NextDrawCall()
    {
        MadDrawCall drawCall;

        if (nextDrawCall >= drawCalls.Count)
        {
            // create new draw call
            drawCall = MadDrawCall.Create();
            drawCall.gameObject.layer = gameObject.layer;

            MadTransform.SetLocalScale(drawCall.transform, transform.lossyScale);
            drawCalls.Add(drawCall);
            nextDrawCall++;
        }
        else
        {
            drawCall = drawCalls[nextDrawCall++];
            MadGameObject.SetActive(drawCall.gameObject, true);
        }

        return(drawCall);
    }
    void UpdateScale()
    {
        float scale;

        switch (resizeMode)
        {
        case ResizeMode.FixedSize:
            scale = 1f / manualHeight * 2;
            break;

        case ResizeMode.PixelPerfect:
            scale = 1f / Mathf.Clamp(screenHeight, minimumHeight, maximumHeight) * 2;
            break;

        default:
            Debug.LogError("Unknown option: " + resizeMode);
            scale = 1f / manualHeight * 2;
            break;
        }

        MadTransform.SetLocalScale(transform, scale);
    }