Example #1
0
    private void Awake()
    {
        if (this.m_awake)
        {
            return;
        }
        this.m_awake = true;
        IUseCamera useCamera = (IUseCamera)base.GetComponent("IUseCamera");

        if (useCamera != null)
        {
            this.renderCamera = useCamera.RenderCamera;
        }
        if (this.renderCamera == null)
        {
            this.renderCamera = Camera.main;
        }
        if (this.relativeTo == null)
        {
            this.relativeTo = new EZScreenPlacement.RelativeTo(this);
        }
        else if (this.relativeTo.Script != this)
        {
            EZScreenPlacement.RelativeTo relativeTo = new EZScreenPlacement.RelativeTo(this, this.relativeTo);
            this.relativeTo = relativeTo;
        }
    }
Example #2
0
    void Awake()
    {
        if (m_awake)
        {
            return;
        }
        m_awake = true;

        IUseCamera uc = (IUseCamera)GetComponent("IUseCamera");

        if (uc != null)
        {
            renderCamera = uc.RenderCamera;
        }

        if (renderCamera == null)
        {
            renderCamera = Camera.main;
        }

        if (relativeTo == null)
        {
            relativeTo = new RelativeTo(this);
        }
        else if (relativeTo.Script != this)
        {
            // This appears to be a duplicate object,
            // so create our own copy of the relativeTo:
            RelativeTo newRT = new RelativeTo(this, relativeTo);
            relativeTo = newRT;
        }
    }
Example #3
0
    void Awake()
    {
        if (m_awake)
        {
            return;
        }
        m_awake = true;

        IUseCamera uc = (IUseCamera)GetComponent("IUseCamera");

        if (uc != null)
        {
            renderCamera = uc.RenderCamera;
        }

        if (renderCamera == null)
        {
            renderCamera = Camera.main;
        }

        screenSize.x = renderCamera.pixelWidth;
        screenSize.y = renderCamera.pixelHeight;

        PositionOnScreenRecursively();
    }