void Awake() { if (!_instance) { _instance = this; } distanceBetweenMenus -= IsDivisble(distanceBetweenMenus, 0.5f); _maxMenuPosition = (menuItems.Length + 1) * distanceBetweenMenus; startingMenuItem = Mathf.Clamp(startingMenuItem, 1, menuItems.Length); _currentMenuPosition = ((1) * distanceBetweenMenus) * startingMenuItem; ParentMenuItems(); UpdateMenuItemsPositionInWorldSpace(); if (GetComponent <TouchHandler> () == null) { gameObject.AddComponent <TouchHandler> (); } _swipeHandler = GetComponent <SwipeHandler> (); if (_swipeHandler == null) { _swipeHandler = gameObject.AddComponent <SwipeHandler> (); } }
void Awake() { transform.SetAsFirstSibling(); if (!_instance) { _instance = this; } distanceBetweenMenus -= IsDivisble(distanceBetweenMenus, 0.5f); _maxMenuPosition = (menuItems.Length + 1) * distanceBetweenMenus; startingMenuItem = Mathf.Clamp(startingMenuItem, 1, menuItems.Length); _currentMenuPosition = ((1) * distanceBetweenMenus) * startingMenuItem; ParentMenuItems(); // UpdateMenuItemsPositionInWorldSpace (); if (GetComponent <TouchHandler> () == null && GetComponent <TouchHandlerMusik>() == null) { gameObject.AddComponent <TouchHandler> (); } _swipeHandler = GetComponent <SwipeHandler> (); if (_swipeHandler == null) { _swipeHandler = gameObject.AddComponent <SwipeHandler> (); } hc.GetLeapController().EnableGesture(Gesture.GestureType.TYPESWIPE); }
void Awake() { if (!_instance) { _instance = this; } button = buttonObj.GetComponent <Button> (); pointText = pointTextObj.GetComponent <TextMeshProUGUI> (); nameText = nameTextObj.GetComponent <TextMeshProUGUI> (); priceText = priceTextObj.GetComponent <TextMeshProUGUI> (); distanceBetweenMenus -= IsDivisble(distanceBetweenMenus, 0.5f); _maxMenuPosition = (menuItems.Length + 1) * distanceBetweenMenus; startingMenuItem = EncryptedPlayerPrefs.LoadInt(Const.KEY_CHARA, 0); selectItem = menuItems [startingMenuItem]; SetCanvasText(); startingMenuItem = Mathf.Clamp((startingMenuItem + 1), 1, menuItems.Length); _currentMenuPosition = ((1) * distanceBetweenMenus) * startingMenuItem; ParentMenuItems(); UpdateMenuItemsPositionInWorldSpace(); if (GetComponent <TouchHandler> () == null) { gameObject.AddComponent <TouchHandler> (); } _swipeHandler = GetComponent <SwipeHandler> (); if (_swipeHandler == null) { _swipeHandler = gameObject.AddComponent <SwipeHandler> (); } }
void Start() { _swipeHandler = GetComponent <SwipeHandler> (); }