public void Hide(PassiveHider hider) { if (passiveHiders.Contains(hider)) { return; } ++usedHiders; passiveHiders.Add(hider); sp.sortingLayerName = layerHide; }
public void UnHide(PassiveHider hider) { if (!passiveHiders.Contains(hider)) { return; } --usedHiders; passiveHiders.Remove(hider); if (usedHiders <= 0) { sp.sortingLayerName = layerDefault; usedHiders = 0; } }