//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createBridgeCover() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = new Quaternion(); GameObject newBridgeCover = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform bridgeCoverBridgeLeftAttach = newBridgeCover.transform.Find("bridge_cover_bridge_left_attach"); Transform bridgeCoverBridgeRightAttach = newBridgeCover.transform.Find("bridge_cover_bridge_right_attach"); Transform bridgeCoverBackSlopeAttach = newBridgeCover.transform.Find("bridge_cover_back_slope_attach"); FuseAttributes fuseAtts = bridgeCoverFuses(); bridgeCoverBridgeLeftAttach.gameObject.AddComponent <FuseBehavior>(); bridgeCoverBridgeLeftAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bridgeCoverBridgeLeftAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("BridgeCover")); bridgeCoverBridgeRightAttach.gameObject.AddComponent <FuseBehavior>(); bridgeCoverBridgeRightAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bridgeCoverBridgeRightAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("BridgeCover")); bridgeCoverBackSlopeAttach.gameObject.AddComponent <FuseBehavior>(); bridgeCoverBackSlopeAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bridgeCoverBackSlopeAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("BridgeCover")); instantiated[0] = newBridgeCover; partCreated[0] = true; selectionManager.newPartCreated("bridgeCoverPrefab(Clone)"); enableManipulationButtons(newBridgeCover); } }
public void createBody() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = new Quaternion(); GameObject newBody = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform bodyTopAttach = newBody.transform.Find("Body_Top_Attach"); Transform bodySideAttach = newBody.transform.Find("Body_Side_Attach"); Transform bodyBottomAttach = newBody.transform.Find("Body_Bottom_Attach"); FuseAttributes fuseAtts = bodyFuses(); bodyTopAttach.gameObject.AddComponent <FuseBehavior>(); bodyTopAttach.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bodyTopAttach.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Body")); bodySideAttach.gameObject.AddComponent <FuseBehavior>(); bodySideAttach.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bodySideAttach.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Body")); bodyBottomAttach.gameObject.AddComponent <FuseBehavior>(); bodyBottomAttach.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bodyBottomAttach.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Body")); instantiated[0] = newBody; partCreated[0] = true; selectionManager.newPartCreated("BodyPrefab(Clone)"); enableManipulationButtons(newBody); } }
public void createB1p1() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = offscreenCreateLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(90, 90, 0); GameObject newB1p1 = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); StartCoroutine(moveToStartingPosition(newB1p1)); // this creates the zooming up from the ground effect Transform b1p1_bb1_a1 = newB1p1.transform.Find("b1p1_bb1_a1"); Transform b1p1 = newB1p1.transform.Find("b1p1"); b1p1.GetComponent <Tooltip>().enabled = true; b1p1_bb1_a1.GetComponent <Tooltip>().enabled = true; FuseAttributes fuseAtts = b1p1Fuses(); b1p1_bb1_a1.gameObject.AddComponent <FuseBehavior>(); b1p1_bb1_a1.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b1p1_bb1_a1.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B1p1")); b1p1_bb1_a1.gameObject.AddComponent <FaceSelector>(); b1p1_bb1_a1.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b1p1_bb1_a1.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); b1p1_bb1_a1.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.down; instantiated[0] = newB1p1; partCreated[0] = true; partButtons[0].interactable = false; selectionManager.newPartCreated("b1p1Prefab(Clone)"); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createLongL() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = new Quaternion(); GameObject newLongL = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform longLBigCornerAttach = newLongL.transform.FindChild("long_l_big_corner_attach"); Transform longLCornerAttach = newLongL.transform.FindChild("long_l_corner_attach"); Transform longLBlockJutsSideAttach = newLongL.transform.FindChild("long_l_block_juts_side_attach"); Transform longLBlockJutsBackAttach = newLongL.transform.FindChild("long_l_block_juts_back_attach"); Transform longLBlockJutsTopAttach = newLongL.transform.FindChild("long_l_block_juts_top_attach"); FuseAttributes fuseAtts = longLFuses(); longLBigCornerAttach.gameObject.AddComponent <FuseBehavior>(); longLBigCornerAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); longLBigCornerAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LongL")); longLCornerAttach.gameObject.AddComponent <FuseBehavior>(); longLCornerAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); longLCornerAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LongL")); longLBlockJutsSideAttach.gameObject.AddComponent <FuseBehavior>(); longLBlockJutsSideAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); longLBlockJutsSideAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LongL")); longLBlockJutsBackAttach.gameObject.AddComponent <FuseBehavior>(); longLBlockJutsBackAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); longLBlockJutsBackAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LongL")); longLBlockJutsTopAttach.gameObject.AddComponent <FuseBehavior>(); longLBlockJutsTopAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); longLBlockJutsTopAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LongL")); instantiated[0] = newLongL; partCreated[0] = true; selectionManager.newPartCreated("long_lPrefab(Clone)"); enableManipulationButtons(newLongL); } }
public void createC() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 180, 0); GameObject newC = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform cMiddleTBottomAttach = newC.transform.Find("c_middle_t_bottom_attach"); Transform cMiddleTFrontAttach = newC.transform.Find("c_middle_t_front_attach"); Transform cMiddleTTopAttach = newC.transform.Find("c_middle_t_top_attach"); Transform cUlCornerAttach = newC.transform.Find("c_ul_corner_attach"); FuseAttributes fuseAtts = cFuses(); cMiddleTBottomAttach.gameObject.AddComponent <FuseBehavior>(); cMiddleTBottomAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); cMiddleTBottomAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("C")); cMiddleTFrontAttach.gameObject.AddComponent <FuseBehavior>(); cMiddleTFrontAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); cMiddleTFrontAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("C")); cMiddleTTopAttach.gameObject.AddComponent <FuseBehavior>(); cMiddleTTopAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); cMiddleTTopAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("C")); cUlCornerAttach.gameObject.AddComponent <FuseBehavior>(); cUlCornerAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); cUlCornerAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("C")); instantiated[0] = newC; partCreated[0] = true; selectionManager.newPartCreated("cPrefab(Clone)"); enableManipulationButtons(newC); } }
public void createPalm() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(90, 0, 90); GameObject newPalm = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform palmArmAttach = newPalm.transform.FindChild("palm_arm_attach"); Transform palmFingersAttach = newPalm.transform.FindChild("palm_fingers_attach"); Transform palmThumbAttach = newPalm.transform.FindChild("palm_thumb_attach"); Transform palmPalmDecAttach = newPalm.transform.FindChild("palm_palm_dec_attach"); FuseAttributes fuseAtts = palmFuses(); palmArmAttach.gameObject.AddComponent <FuseBehavior>(); palmArmAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); palmArmAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Palm")); palmFingersAttach.gameObject.AddComponent <FuseBehavior>(); palmFingersAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); palmFingersAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Palm")); palmThumbAttach.gameObject.AddComponent <FuseBehavior>(); palmThumbAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); palmThumbAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Palm")); palmPalmDecAttach.gameObject.AddComponent <FuseBehavior>(); palmPalmDecAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); palmPalmDecAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Palm")); instantiated[0] = newPalm; partCreated[0] = true; selectionManager.newPartCreated("palmPrefab(Clone)"); enableManipulationButtons(newPalm); } }
public void createRing() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 180, 0); GameObject newRing = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform ringCenterBoxLeftAttach = newRing.transform.FindChild("ring_center_box_left_attach"); Transform ringCenterBoxRightAttach = newRing.transform.FindChild("ring_center_box_right_attach"); Transform ringCenterBoxBackAttach = newRing.transform.FindChild("ring_center_box_back_attach"); Transform ringCenterBoxForwardAttach = newRing.transform.FindChild("ring_center_box_forward_attach"); FuseAttributes fuseAtts = ringFuses(); ringCenterBoxLeftAttach.gameObject.AddComponent <FuseBehavior>(); ringCenterBoxLeftAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringCenterBoxLeftAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Ring")); ringCenterBoxRightAttach.gameObject.AddComponent <FuseBehavior>(); ringCenterBoxRightAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringCenterBoxRightAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Ring")); ringCenterBoxBackAttach.gameObject.AddComponent <FuseBehavior>(); ringCenterBoxBackAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringCenterBoxBackAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Ring")); ringCenterBoxForwardAttach.gameObject.AddComponent <FuseBehavior>(); ringCenterBoxForwardAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringCenterBoxForwardAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Ring")); instantiated[0] = newRing; partCreated[0] = true; selectionManager.newPartCreated("ringPrefab(Clone)"); enableManipulationButtons(newRing); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createSmallboxYellow() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(180, 90, 180); GameObject newSmallboxYellow = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform smallboxYellowLongboxAttach = newSmallboxYellow.transform.FindChild("smallbox_yellow_longbox_attach"); FuseAttributes fuseAtts = smallboxYellowFuses(); smallboxYellowLongboxAttach.gameObject.AddComponent <FuseBehavior>(); smallboxYellowLongboxAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); smallboxYellowLongboxAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("SmallboxYellow")); instantiated[0] = newSmallboxYellow; partCreated[0] = true; selectionManager.newPartCreated("tutorial2_smallbox_yellowPrefab(Clone)"); enableManipulationButtons(newSmallboxYellow); } }
public void createUprightL() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 0, 90); GameObject newUprightL = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform uprightLDanglyTAttach = newUprightL.transform.FindChild("upright_L_dangly_T_attach"); Transform uprightLWaluigiAttach = newUprightL.transform.FindChild("upright_L_waluigi_attach"); //fixes off center rotation problem //bodyChild.transform.localPosition = new Vector3(0,0,0); //bodyGripAttach.transform.localPosition = new Vector3(0, -0.35f, 0); //bodyStrutLeftAttach.transform.localPosition = new Vector3(-0.6f, 1.4f, -0.42f); //bodyStrutRightAttach.transform.localPosition = new Vector3(0.7f, 1.4f, -0.2f); //bodyStrutTopAttach.transform.localPosition = new Vector3(0, 1.4f, 0.4f); FuseAttributes fuseAtts = uprightLFuses(); uprightLDanglyTAttach.gameObject.AddComponent <FuseBehavior>(); uprightLDanglyTAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); uprightLDanglyTAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("UprightL")); uprightLWaluigiAttach.gameObject.AddComponent <FuseBehavior>(); uprightLWaluigiAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); uprightLWaluigiAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("UprightL")); instantiated[0] = newUprightL; partCreated[0] = true; selectionManager.newPartCreated("upright_LPrefab(Clone)"); enableManipulationButtons(newUprightL); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createHaft() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 90, 0); GameObject newHaft = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform haftShaftAttach = newHaft.transform.Find("haft_shaft_attach"); FuseAttributes fuseAtts = haftFuses(); haftShaftAttach.gameObject.AddComponent <FuseBehavior>(); haftShaftAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); haftShaftAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Haft")); instantiated[0] = newHaft; partCreated[0] = true; selectionManager.newPartCreated("haftPrefab(Clone)"); enableManipulationButtons(newHaft); } }
public void createPyr() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(180, 0, 90); GameObject newPyr = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform pyrBoxAttach = newPyr.transform.Find("pyr_box_attach"); FuseAttributes fuseAtts = pyrFuses(); pyrBoxAttach.gameObject.AddComponent <FuseBehavior>(); pyrBoxAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); pyrBoxAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Pyr")); instantiated[0] = newPyr; partCreated[0] = true; selectionManager.newPartCreated("tutorial1_pyrPrefab(Clone)"); enableManipulationButtons(newPyr); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createLeftStrap() { if (!partCreated[1]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(90, 0, 90); GameObject newLeftStrap = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[1], pos, fuseToRotation))); Transform backStraLongBackStrapShortAttach = newLeftStrap.transform.FindChild("back_strap_long_back_strap_short_attach"); Transform leftStrapVestBaseBottomAttach = newLeftStrap.transform.FindChild("left_strap_vest_base_bottom_attach"); Transform leftStrapVestBaseTopAttach = newLeftStrap.transform.FindChild("left_strap_vest_base_top_attach"); FuseAttributes fuseAtts = leftStrapFuse(); backStraLongBackStrapShortAttach.gameObject.AddComponent <FuseBehavior>(); backStraLongBackStrapShortAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); backStraLongBackStrapShortAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LeftStrap")); leftStrapVestBaseBottomAttach.gameObject.AddComponent <FuseBehavior>(); leftStrapVestBaseBottomAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); leftStrapVestBaseBottomAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LeftStrap")); leftStrapVestBaseTopAttach.gameObject.AddComponent <FuseBehavior>(); leftStrapVestBaseTopAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); leftStrapVestBaseTopAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("LeftStrap")); instantiated[1] = newLeftStrap; partCreated[1] = true; selectionManager.newPartCreated("left_strapPrefab(Clone)"); enableManipulationButtons(newLeftStrap); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createAxle() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(90, 270, 0); GameObject newAxle = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform axleLeftSupportAttach = newAxle.transform.FindChild("axle_left_support_attach"); Transform axleRightSupportAttach = newAxle.transform.FindChild("axle_right_support_attach"); Transform axleThrowingArmLeftAttach = newAxle.transform.FindChild("axle_throwing_arm_left_attach"); Transform axleThrowingArmRightAttach = newAxle.transform.FindChild("axle_throwing_arm_right_attach"); Transform axleThrowingArmBottomAttach = newAxle.transform.FindChild("axle_throwing_arm_bottom_attach"); FuseAttributes fuseAtts = axleFuses(); axleLeftSupportAttach.gameObject.AddComponent <FuseBehavior>(); axleLeftSupportAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); axleLeftSupportAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Axle")); axleRightSupportAttach.gameObject.AddComponent <FuseBehavior>(); axleRightSupportAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); axleRightSupportAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Axle")); axleThrowingArmLeftAttach.gameObject.AddComponent <FuseBehavior>(); axleThrowingArmLeftAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); axleThrowingArmLeftAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Axle")); axleThrowingArmRightAttach.gameObject.AddComponent <FuseBehavior>(); axleThrowingArmRightAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); axleThrowingArmRightAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Axle")); axleThrowingArmBottomAttach.gameObject.AddComponent <FuseBehavior>(); axleThrowingArmBottomAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); axleThrowingArmBottomAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Axle")); instantiated[0] = newAxle; partCreated[0] = true; selectionManager.newPartCreated("axlePrefab(Clone)"); enableManipulationButtons(newAxle); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createBallfoot() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = offscreenCreateLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 90, 0); GameObject newBallfoot = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); StartCoroutine(moveToStartingPosition(newBallfoot)); // this creates the zooming up from the ground effect Transform ballfootMidfootAttach = newBallfoot.transform.Find("ballfoot_midfoot_attach"); Transform ballfootToeAttach = newBallfoot.transform.Find("ballfoot_toe_attach"); FuseAttributes fuseAtts = ballfootFuses(); // ballfoot_Midfoot_Attach ballfootMidfootAttach.gameObject.AddComponent <FuseBehavior>(); ballfootMidfootAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ballfootMidfootAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Ballfoot")); ballfootMidfootAttach.gameObject.AddComponent <FaceSelector>(); ballfootMidfootAttach.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.left; ballfootMidfootAttach.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); ballfootMidfootAttach.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); // ballfoot_Toe_Attach ballfootToeAttach.gameObject.AddComponent <FuseBehavior>(); ballfootToeAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ballfootToeAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("Ballfoot")); ballfootToeAttach.gameObject.AddComponent <FaceSelector>(); ballfootToeAttach.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.right; ballfootToeAttach.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); ballfootToeAttach.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); instantiated[0] = newBallfoot; partCreated[0] = true; partButtons[0].interactable = false; selectionManager.newPartCreated("ballfootPrefab(Clone)"); } }
public void createRingLargePart() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 180, 0); GameObject newRingLargePart = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); Transform ringLargePartCenterBoxSideAttach = newRingLargePart.transform.Find("ring_large_part_center_box_side_attach"); Transform ringLargePartRingLongPartAttach = newRingLargePart.transform.Find("ring_large_part_ring_long_part_attach"); Transform ringLargePartCenterBoxBackAttach = newRingLargePart.transform.Find("ring_large_part_center_box_back_attach"); Transform ringLargePartRingSmallPartAttach = newRingLargePart.transform.Find("ring_large_part_ring_small_part_attach"); Transform ringLargePartLeftTriAttach = newRingLargePart.transform.Find("ring_large_part_tri_attach"); FuseAttributes fuseAtts = ringLargePartFuses(); ringLargePartCenterBoxSideAttach.gameObject.AddComponent <FuseBehavior>(); ringLargePartCenterBoxSideAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringLargePartCenterBoxSideAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("RingLargePart")); ringLargePartRingLongPartAttach.gameObject.AddComponent <FuseBehavior>(); ringLargePartRingLongPartAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringLargePartRingLongPartAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("RingLargePart")); ringLargePartCenterBoxBackAttach.gameObject.AddComponent <FuseBehavior>(); ringLargePartCenterBoxBackAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringLargePartCenterBoxBackAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("RingLargePart")); ringLargePartRingSmallPartAttach.gameObject.AddComponent <FuseBehavior>(); ringLargePartRingSmallPartAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringLargePartRingSmallPartAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("RingLargePart")); ringLargePartLeftTriAttach.gameObject.AddComponent <FuseBehavior>(); ringLargePartLeftTriAttach.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); ringLargePartLeftTriAttach.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("RingLargePart")); instantiated[0] = newRingLargePart; partCreated[0] = true; selectionManager.newPartCreated("ring_large_partPrefab(Clone)"); enableManipulationButtons(newRingLargePart); } }
//CHANGE these next 5 methods so that they refer to the 5 prefabs you made. This requires you to // change most of the variables and strings in each method. public void createBottomPointLeft() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = createLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 90, 0); GameObject newBottomPointLeft = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); GameObject bottomPointLeftHeadAttach = GameObject.Find("bottom_point_left_head_attach"); GameObject bottomPointLeftRightAttach = GameObject.Find("bottom_point_left_right_attach"); FuseAttributes fuseAtts = bottomPointLeftFuses(); bottomPointLeftHeadAttach.AddComponent <FuseBehavior>(); bottomPointLeftHeadAttach.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bottomPointLeftHeadAttach.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("BottomPointLeft")); bottomPointLeftRightAttach.AddComponent <FuseBehavior>(); bottomPointLeftRightAttach.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); bottomPointLeftRightAttach.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("BottomPointLeft")); instantiated[0] = newBottomPointLeft; partCreated[0] = true; partButtons[0].interactable = false; selectionManager.newPartCreated("bottom_point_leftPrefab(Clone)"); enableManipulationButtons(newBottomPointLeft); } }
public void createB3p1() { if (!partCreated[0]) { clearPartsCreated(); Vector3 pos = offscreenCreateLoc; // this is where the object will appear when it's instantiated Quaternion fuseToRotation = Quaternion.Euler(0, 270, 180); GameObject newB3p1 = rotateGizmo.Enable(LoadUtils.InstantiateParenter((GameObject)Instantiate(parts[0], pos, fuseToRotation))); StartCoroutine(moveToStartingPosition(newB3p1)); // this creates the zooming up from the ground effect Transform b3p1_bb3_a1 = newB3p1.transform.Find("b3p1_bb3_a1"); Transform b3p1_bb3_a2 = newB3p1.transform.Find("b3p1_bb3_a2"); Transform b3p1_bb3_a3 = newB3p1.transform.Find("b3p1_bb3_a3"); Transform b3p1_bb3_a4 = newB3p1.transform.Find("b3p1_bb3_a4"); Transform b3p1_bb3_a5 = newB3p1.transform.Find("b3p1_bb3_a5"); Transform b3p1_bb3_a6 = newB3p1.transform.Find("b3p1_bb3_a6"); FuseAttributes fuseAtts = b3p1Fuses(); //b3p1_bb3_a1 b3p1_bb3_a1.gameObject.AddComponent <FuseBehavior>(); b3p1_bb3_a1.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b3p1_bb3_a1.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B3p1")); b3p1_bb3_a1.gameObject.AddComponent <FaceSelector>(); b3p1_bb3_a1.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.forward; b3p1_bb3_a1.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b3p1_bb3_a1.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); //b3p1_bb3_a2 b3p1_bb3_a2.gameObject.AddComponent <FuseBehavior>(); b3p1_bb3_a2.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b3p1_bb3_a2.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B3p1")); b3p1_bb3_a2.gameObject.AddComponent <FaceSelector>(); b3p1_bb3_a2.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.down; b3p1_bb3_a2.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b3p1_bb3_a2.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); //b3p1_bb3_a3 b3p1_bb3_a3.gameObject.AddComponent <FuseBehavior>(); b3p1_bb3_a3.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b3p1_bb3_a3.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B3p1")); b3p1_bb3_a3.gameObject.AddComponent <FaceSelector>(); b3p1_bb3_a3.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.forward; b3p1_bb3_a3.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b3p1_bb3_a3.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); //b3p1_bb3_a4 b3p1_bb3_a4.gameObject.AddComponent <FuseBehavior>(); b3p1_bb3_a4.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b3p1_bb3_a4.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B3p1")); b3p1_bb3_a4.gameObject.AddComponent <FaceSelector>(); b3p1_bb3_a4.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.up; b3p1_bb3_a4.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b3p1_bb3_a4.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); //b3p1_bb3_a5 b3p1_bb3_a5.gameObject.AddComponent <FuseBehavior>(); b3p1_bb3_a5.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b3p1_bb3_a5.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B3p1")); b3p1_bb3_a5.gameObject.AddComponent <FaceSelector>(); b3p1_bb3_a5.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.left; b3p1_bb3_a5.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b3p1_bb3_a5.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); //b3p1_bb3_a6 b3p1_bb3_a6.gameObject.AddComponent <FuseBehavior>(); b3p1_bb3_a6.gameObject.GetComponent <FuseBehavior>().setFuseTo(fuseAtts); b3p1_bb3_a6.gameObject.GetComponent <FuseBehavior>().setButtonTo(GameObject.Find("B3p1")); b3p1_bb3_a6.gameObject.AddComponent <FaceSelector>(); b3p1_bb3_a6.gameObject.GetComponent <FaceSelector>().selectedNormal = Vector3.right; b3p1_bb3_a6.gameObject.GetComponent <FaceSelector>().setSelectPartScript(GameObject.Find("EventSystem").GetComponent <SelectPart>()); b3p1_bb3_a6.gameObject.GetComponent <FaceSelector>().setFuseButton(GameObject.Find("FuseButton").GetComponent <Button>()); instantiated[0] = newB3p1; partCreated[0] = true; partButtons[0].interactable = false; selectionManager.newPartCreated("b3p1Prefab(Clone)"); } }