// remove output or add output to outputs public override void EditOutput(GameObject to, bool remove) { DataChainObjectBase[] temp; if (remove) { int min = 0; temp = new DataChainObjectBase[outputs.Length - 1]; for (int i = 0; i < outputs.Length; i++) { if (outputs[i].gameObject == to) { min = 1; } else { temp[i - min] = outputs[i]; } } } else { temp = new DataChainObjectBase[outputs.Length + 1]; for (int i = 0; i < outputs.Length; i++) { temp[i] = outputs[i]; } temp[temp.Length - 1] = to.GetComponent <DataChainObjectBase>(); } outputs = temp; }
public DataChainObjectBase input; // input Date Chain object // [[ Functions ]] // toggle the input for a object if space available public override int ToggleInput(GameObject toCheck) { if (input != null) { if (input == toCheck.GetComponent <DataChainObjectBase>()) { input = null; return(2); } return(0); } input = toCheck.GetComponent <DataChainObjectBase>(); return(1); }