示例#1
0
    // 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;
    }
示例#2
0
        internal int FindShortestIntersectionPath()
        {
            var intersections = GetWireIntersections();

            intersections.Remove(Origin);

            return(intersections.Select(coordinate => RedWire.GetPathLengthToCoordinate(coordinate) + BlueWire.GetPathLengthToCoordinate(coordinate)).Min());
        }