Exemple #1
0
    void UpdateObjectAnchor()
    {
        if (anchorObject == null)
        {
            return;
        }

        Camera camera = anchorCamera;

        if (camera == null)
        {
            if (Application.isPlaying)
            {
                MadDebug.LogOnce("Anchor camera not set. Using main camera.", this);
            }
            camera = Camera.main;
            if (camera == null)
            {
                Debug.LogWarning("There's no camera tagged as MainCamera on this scene. Please make sure that there is one or assign a custom camera to this anchor object.", this);
                return;
            }
        }

        var pos = panel.WorldToPanel(camera, anchorObject.transform.position);

        MadTransform.SetPosition(transform, pos);
    }
Exemple #2
0
    void UpdateScreenAnchor()
    {
        var input = FromPosition(position);

        MadTransform.SetPosition(transform, input);
    }