예제 #1
0
        private static void CreateButton()
        {
            if (!tckGUIobj)
            {
                CreateTouchManager();
            }

            SetupController <ButtonUgui>(ref Button, tckGUIobj.transform, "Button" + FindObjectsOfType <ButtonUgui>().Length.ToString(), true);

            ButtonUgui btnTemp = Button.GetComponent <ButtonUgui>();

            btnTemp.normalSprite  = AssetDatabase.LoadAssetAtPath <Sprite>("Assets/" + nameAbbrev + "/Base/Resources/Sprites/ButtonNormal.png");
            btnTemp.pressedSprite = AssetDatabase.LoadAssetAtPath <Sprite>("Assets/" + nameAbbrev + "/Base/Resources/Sprites/ButtonPressed.png");
            btnTemp.MyName        = Button.name;
            btnTemp.myData.touchzoneRect.sizeDelta        = new Vector2(55f, 55f);
            Button.transform.localScale                   = Vector3.one;
            btnTemp.myData.touchzoneRect.anchoredPosition = RandomPos;
        }
예제 #2
0
 // OnEnable
 void OnEnable()
 {
     myTarget = ( ButtonUgui )target;
     EventsHelper.HelperSetup(myTarget);
 }