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; } }
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; } }
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(); }