// Start is called before the first frame update void Start() { timer = GameObject.Find("Timer").GetComponent <TimerContoller>(); yellowWire = GameObject.Find("Yellow_Wire").GetComponent <YellowWire>(); blueWire = GameObject.Find("Blue_Wire").GetComponent <BlueWire>(); redWire = GameObject.Find("Red_Wire").GetComponent <RedWire>(); whiteWire = GameObject.Find("White_Wire").GetComponent <WhiteWire>(); countScene = GameObject.Find("CountScene").GetComponent <CountScene>(); randomSceneIngameHard = GameObject.Find("RndScene").GetComponent <RandomSceneIngameHard>(); corretSound = GameObject.Find("CorretSound").GetComponent <AudioSource>(); wrongSound = GameObject.Find("WrongSound").GetComponent <AudioSource>(); yellowSound = false; blueSound = false; redSound = false; whiteSound = false; }
internal int FindShortestIntersectionPath() { var intersections = GetWireIntersections(); intersections.Remove(Origin); return(intersections.Select(coordinate => RedWire.GetPathLengthToCoordinate(coordinate) + BlueWire.GetPathLengthToCoordinate(coordinate)).Min()); }