Пример #1
0
        /// <summary>
        /// Init this instance.
        /// </summary>
        protected virtual void Init()
        {
            actualNegativeButton = (ITouchButton)negativeButton.GetComponent (typeof(ITouchButton));
            actualPositiveButton = (ITouchButton)positiveButton.GetComponent (typeof(ITouchButton));

            if (actualNegativeButton == null) Debug.LogWarning ("Couldn't find the negative button for the touch axis");
            if (actualPositiveButton == null) Debug.LogWarning ("Couldn't find the positive button for the touch axis");
        }
Пример #2
0
        /// <summary>
        /// Init this instance.
        /// </summary>
        virtual protected void Init()
        {
            actualNegativeButton = (ITouchButton)negativeButton.GetComponent(typeof(ITouchButton));
            actualPositiveButton = (ITouchButton)positiveButton.GetComponent(typeof(ITouchButton));

            if (actualNegativeButton == null)
            {
                Debug.LogWarning("Couldn't find the negative button for the touch axis");
            }
            if (actualPositiveButton == null)
            {
                Debug.LogWarning("Couldn't find the positive button for the touch axis");
            }
        }
Пример #3
0
        /// <summary>
        /// Init this instance.
        /// </summary>
        virtual protected void Init()
        {
            // Get all the axis and button refs
            actualHorizontalAxis = (ITouchAxis)horizontalAxisGo.GetComponent(typeof(ITouchAxis));
            if (actualHorizontalAxis == null)
            {
                Debug.LogWarning("Couldn't find an ITouchAxis on the horizontal axis GameObject");
            }
            if (verticalAxisGo != null)
            {
                actualVerticalAxis = (ITouchAxis)verticalAxisGo.GetComponent(typeof(ITouchAxis));
                if (actualVerticalAxis == null)
                {
                    Debug.LogWarning("Couldn't find an ITouchAxis on the vertical axis GameObject");
                }
            }


            actualJumpButton = (ITouchButton)jumpButtonGo.GetComponent(typeof(ITouchButton));
            if (runButtonGo != null)
            {
                actualRunButton = (ITouchButton)runButtonGo.GetComponent(typeof(ITouchButton));
                if (actualRunButton == null)
                {
                    Debug.LogWarning("Couldn't find a ITouchButton on the run button GameObject");
                }
            }
            if (pauseButtonGo != null)
            {
                actualPauseButton = (ITouchButton)pauseButtonGo.GetComponent(typeof(ITouchButton));
                if (actualPauseButton == null)
                {
                    Debug.LogWarning("Couldn't find a ITouchButton on the pause button GameObject");
                }
            }

            actualActionButtons = new ITouchButton[actionButtonGos.Length];
            for (int i = 0; i < actionButtonGos.Length; i++)
            {
                if (actionButtonGos[i] != null)
                {
                    actualActionButtons[i] = (ITouchButton)actionButtonGos[i].GetComponent(typeof(ITouchButton));
                    if (actualActionButtons[i] == null)
                    {
                        Debug.LogWarning("Couldn't find a ITouchButton on the action button GameObject for button " + i);
                    }
                }
            }
        }