// OnEnable void OnEnable() { myTarget = ( DPadGuiTexture )target; AxesHelper.HelperSetup(myTarget); EventsHelper.HelperSetup(myTarget); }
// OnEnable void OnEnable() { myTarget = ( DPadGuiTexture )target; AxesHelper.HelperSetup( myTarget ); EventsHelper.HelperSetup( myTarget ); }
private static void CreateDPad() { if (!tckGUIobj) { CreateTouchManager(); } SetupController <DPadGuiTexture>(ref DpadMain, tckGUIobj.transform, "DPad" + tckGUIobj.GetComponentsInChildren <DPadGuiTexture>().Length.ToString(), Vector3.zero); DPadGuiTexture dpadTemp = DpadMain.GetComponent <DPadGuiTexture>(); dpadTemp.myData.touchzoneGUITexture = dpadTemp.GetComponent <GUITexture>(); dpadTemp.myData.touchzoneGUITexture.color = ElementTransparency.colorHalfGuiTexture; dpadTemp.myData.touchzoneGUITexture.texture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Sprites/Touchzone.png"); dpadTemp.MyName = DpadMain.name; dpadTemp.myData.ImageWidth = 12f; dpadTemp.myData.ImageHeight = 12f; dpadTemp.myData.OffsetX = Random.Range(-35f, 35f); dpadTemp.myData.OffsetY = Random.Range(-35f, 35f); DPadArrowGuiTexture tempArrow = null; // SetupController <DPadArrowGuiTexture>(ref DpadArrowUP, DpadMain.transform, "ArrowUP", Vector3.zero); tempArrow = DpadArrowUP.GetComponent <DPadArrowGuiTexture>(); tempArrow.ArrowType = DPadArrowBase.ArrowTypes.UP; tempArrow.normalTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowUpNormal.png"); tempArrow.pressedTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowUpPressed.png"); tempArrow.myData.ImageWidth = 4f; tempArrow.myData.ImageHeight = 4f; // SetupController <DPadArrowGuiTexture>(ref DpadArrowDOWN, DpadMain.transform, "ArrowDOWN", Vector3.zero); tempArrow = DpadArrowDOWN.GetComponent <DPadArrowGuiTexture>(); tempArrow.ArrowType = DPadArrowBase.ArrowTypes.DOWN; tempArrow.normalTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowDownNormal.png"); tempArrow.pressedTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowDownPressed.png"); tempArrow.myData.ImageWidth = 4f; tempArrow.myData.ImageHeight = 4f; // SetupController <DPadArrowGuiTexture>(ref DpadArrowLEFT, DpadMain.transform, "ArrowLEFT", Vector3.zero); tempArrow = DpadArrowLEFT.GetComponent <DPadArrowGuiTexture>(); tempArrow.ArrowType = DPadArrowBase.ArrowTypes.LEFT; tempArrow.normalTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowLeftNormal.png"); tempArrow.pressedTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowLeftPressed.png"); tempArrow.myData.ImageWidth = 4f; tempArrow.myData.ImageHeight = 4f; // SetupController <DPadArrowGuiTexture>(ref DpadArrowRIGHT, DpadMain.transform, "ArrowRIGHT", Vector3.zero); tempArrow = DpadArrowRIGHT.GetComponent <DPadArrowGuiTexture>(); tempArrow.ArrowType = DPadArrowBase.ArrowTypes.RIGHT; tempArrow.normalTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowRightNormal.png"); tempArrow.pressedTexture = Resources.LoadAssetAtPath <Texture2D>("Assets/" + nameAbbrev + "/Base/Resources/Textures/ArrowRightPressed.png"); tempArrow.myData.ImageWidth = 4f; tempArrow.myData.ImageHeight = 4f; TouchManagerGuiTexture.Obsolete(); }