private void OnMouseEnter() { Color matColor; if (mapElementFactory.chosedMapElement == MapElement.Null) { return; } if (!designerManager.joeOnIt(Row, Column) && mapElementFactory.chosedMapElement == MapElement.Box) { matColor = enableColor; } else if (mapElementFactory.chosedMapElement == MapElement.Joe && designerManager.GetMapElement(Row, Column) != MapElement.Edge) { matColor = enableColor; } else { matColor = disableColor; } Material[] mats = meshRenderer.materials; for (int i = 0; i < mats.Length; i++) { mats[i].color = matColor; } }
private void OnMouseEnter() { Color matColor; if (mapElementFactory.chosedMapElement == MapElement.Null) { return; } if (designerManager.joeOnIt(Row, Column) && mapElementFactory.chosedMapElement == MapElement.Box) { matColor = disableColor; } else if (mapElementFactory.chosedMapElement == MapElement.Joe && designerManager.GetMapElement(Row, Column) == MapElement.Edge) { matColor = disableColor; } else if ((mapElementFactory.chosedMapElement == MapElement.LaserGate || mapElementFactory.chosedMapElement == MapElement.Door) && (edgeMapElementPlace || !designerManager.ThreePlace(Row, Column))) { matColor = disableColor; } else { matColor = enableColor; } Color color = meshRenderer.material.color; color = matColor; color.a = 255f; meshRenderer.material.color = color; }