public void DirectionOutput(int tick, GameObject SourceInstance) { ElectricityFunctions.DirectionOutput(tick, SourceInstance, this); int SourceInstanceID = SourceInstance.GetInstanceID(); DownstreamCount = Downstream [SourceInstanceID].Count; UpstreamCount = Upstream [SourceInstanceID].Count; //Logger.Log (this.gameObject.GetInstanceID().ToString() + " <ID | Downstream = "+Downstream[SourceInstanceID].Count.ToString() + " Upstream = " + Upstream[SourceInstanceID].Count.ToString (), Category.Electrical); }
public void DirectionOutput(int tick, GameObject SourceInstance) { int SourceInstanceID = SourceInstance.GetInstanceID(); // foreach (IElectricityIO ConnectedTo in Downstream [SourceInstanceID]) { // Logger.Log (ConnectedTo.ToString () + "Special connection On wire" + this.name); // } //Logger.Log("to man"); if (connections.Count > 2) { //Logger.Log ("Greater than 2"); ElectricityFunctions.DirectionOutput(tick, SourceInstance, this); //int SourceInstanceID = SourceInstance.GetInstanceID(); DownstreamCount = Downstream [SourceInstanceID].Count; UpstreamCount = Upstream [SourceInstanceID].Count; } else { //int SourceInstanceID = SourceInstance.GetInstanceID (); //Logger.Log ("not than 2 " + connections.Count.ToString()); for (int i = 0; i < connections.Count; i++) { if (!(Upstream [SourceInstanceID].Contains(connections [i])) && (!(this == connections [i]))) { if (!(Downstream[SourceInstanceID].Contains(connections [i]))) { Downstream [SourceInstanceID].Add(connections [i]); connections [i].DirectionInput(tick, SourceInstance, this, CameFromMemory); } } } } //Logger.Log (this.gameObject.GetInstanceID().ToString() + " <ID | Downstream = "+Downstream[SourceInstanceID].Count.ToString() + " Upstream = " + Upstream[SourceInstanceID].Count.ToString (), Category.Electrical); }