Exemple #1
0
    void updateToWorldObjectAttachPoint(ref UIAttach_ToWorldObjectAttachPoint inAttach)
    {
        Vector2 theViewportNormalizedPosition = getViewportNormalizedPositionForWorldPosition(
            inAttach.attachPoint.getAttachPointWorld()
            );

        inAttach.UITransform.anchorMax = theViewportNormalizedPosition;
        inAttach.UITransform.anchorMin = theViewportNormalizedPosition;
    }
Exemple #2
0
    //Methods
    //-API
    public void attach(
        GameObject inUI, WorldObjectAttachPoint inAttachPoint, bool inDestroyUIWithObject = true)
    {
        XUtils.getComponent <RectTransform>(
            inUI, XUtils.AccessPolicy.ShouldExist
            ).SetParent(_worldAttachTransform, false);

        var theNewAttach = new UIAttach_ToWorldObjectAttachPoint(
            inUI.GetComponent <RectTransform>(), inAttachPoint, inDestroyUIWithObject
            );

        _uiAttaches_toWorldObjectAttachPoint.add(theNewAttach);
    }