/// <summary> /// check if the configuration changed. if so change the GameObject parameters remove them and create new ones if needed /// </summary> void Update() { if (m_renderType != m_lastRenderType || m_bgType != m_lastBGType) { UpdateBGImage(); } if (m_renderType != m_lastRenderType || m_maskType != m_lastMaskType || m_outline != m_lastOutline) { UpdatePlayerMasks(); } if (m_rect != m_lastPlaceToDraw || m_snapToPosition != m_lastSnapToPosition) { if (m_renderType == RenderType.GUITexture) { FixChildGUITexturePositions(); } else if (m_renderType == RenderType.OnGUI) { } } m_lastRenderType = m_renderType; m_lastBGType = m_bgType; m_lastMaskType = m_maskType; m_lastOutline = m_outline; m_lastPlaceToDraw = m_rect; m_lastSnapToPosition = m_snapToPosition; }
void Awake() { if (m_bgType != BGType.None) { UpdateBGImage(); } if (m_maskType != MaskType.None) { UpdatePlayerMasks(); } m_lastRenderType = m_renderType; m_lastBGType = m_bgType; m_lastMaskType = m_maskType; m_lastOutline = m_outline; m_lastPlaceToDraw = m_rect; m_lastSnapToPosition = m_snapToPosition; }