public static void SetBlockedLOS(WeaponRangeIndicators __instance, bool usingMultifire) { try { if (lineB == null) { return; } LosMaterial mat = Mats[BlockedPost][dirIndex]; lineB.material = mat.GetMaterial(); lineB.startColor = lineB.endColor = lineB.material.color; lineB.startWidth = lineB.endWidth = mat.Width; lineB.gameObject?.SetActive(true); } catch (Exception ex) { Error(ex); } }
private static LosMaterial[] NewMat(Line line) { string name = line.ToString(); Color?[] colors = parsedColours[line]; bool dotted = (bool)typeof(ModSettings).GetField("LOS" + name + "Dotted").GetValue(Settings); //Log( "LOS " + line + " = " + Join( ",", colors ) ); LosMaterial[] lineMats = new LosMaterial[LOSDirectionCount]; for (int i = 0; i < LOSDirectionCount; i++) { string matName = name + "LOS" + i; float width = (float)(i != BlockedPost ? Settings.LOSWidth : Settings.LOSWidthBlocked); Color colour = colors[i] ?? OrigColours[i != NoAttack ? 0 : 1]; lineMats[i] = LinesAnimated ? new LosAnimated(colour, dotted, width, matName) : new LosMaterial(colour, dotted, width, matName); } return(lineMats); }