// Use this for initialization void Start() { GameObject p1 = GameObject.Find("puzzleBlock_01 3"); piece1 = p1.GetComponent <RotatePuzle>(); GameObject p2 = GameObject.Find("puzzleBlock_02 3"); piece2 = p2.GetComponent <RotatePuzle>(); GameObject p3 = GameObject.Find("puzzleBlock_03 3"); piece3 = p3.GetComponent <RotatePuzle>(); GameObject p4 = GameObject.Find("puzzleBlock_04 3"); piece4 = p4.GetComponent <RotatePuzle>(); }
// Use this for initialization void Start() { //access each pieces rotation script GameObject p1 = GameObject.Find("puzzleBlock_01"); piece1 = p1.GetComponent <RotatePuzle>(); GameObject p2 = GameObject.Find("puzzleBlock_02"); piece2 = p2.GetComponent <RotatePuzle>(); GameObject p3 = GameObject.Find("puzzleBlock_03"); piece3 = p3.GetComponent <RotatePuzle>(); GameObject p4 = GameObject.Find("puzzleBlock_04"); piece4 = p4.GetComponent <RotatePuzle>(); }