public compound_task(node p, type tp, subType stp, string n) { parent = p; t = tp; behaviorName = n; st = stp; }
public void Activate(Hex newHab, warningType newType, subType[] newSubType, Sprite[] newSprite, Color32[] newColor) { if (!warnControl) { warnControl = FindObjectOfType<WarningsController>(); } warning = newType; for (int i = 0; i < newSubType.Length; i++) { SetIcon(newSprite[0]); SetColor(newColor[0]); } AddWarning(newHab, newSubType, newSprite, newColor); }
private void RemoveSubType(subType sub) { if (warningSubTypes.Contains(sub)) { warningSubTypes.Remove(sub); warningSubTypes.TrimExcess(); } }
private void AddWarning(Hex newHab, subType[] newSubType, Sprite[] newSprites, Color32[] newColors) { GameObject lineObject = Instantiate(linePrefab, new Vector3(-2, -2, 0), Quaternion.identity) as GameObject; GlobalLine lineScript = lineObject.GetComponent<GlobalLine>(); lineObject.transform.SetParent(warnControl.GetDetailsPanel().transform, false); lineScript.Activate(this, newHab, newSubType, newSprites, newColors); activeLines.Add(lineScript); foreach (subType item in newSubType) { AddSubtype(item); } if (WarningsController.GetSelectedWarning() == this) { PopulatePanel(); } else { HideWarnings(); } }
private void AddSubtype(subType sub) { if (!warningSubTypes.Contains(sub)) { warningSubTypes.Add(sub); } }
public void RemoveWarningsBySubType(subType sub) { List<GlobalLine> lines = new List<GlobalLine>(); foreach (GlobalLine item in activeLines) { foreach(subType thing in item.GetSubTypes()) { if (sub == thing) { lines.Add(item); } } } foreach (GlobalLine item in lines) { activeLines.Remove(item); Destroy(item.gameObject); } activeLines.TrimExcess(); RemoveSubType(sub); DeactivationCheck(); }
public void RemoveSubWarning(Hex newHab, subType newSubType) { GlobalLine line = DetermineGlobalLineFromHex(newHab); if (line) { GameObject targetLine = DetermineGlobalLineFromHex(newHab).gameObject; if (targetLine != null) { GlobalLine lineScript = targetLine.GetComponent<GlobalLine>(); lineScript.RemoveIcon(newSubType); if (LinesCheck(lineScript)) { activeLines.Remove(lineScript); activeLines.TrimExcess(); Destroy(targetLine.gameObject); DeactivationCheck(); } } } }