/// <summary>
        /// Toggles input managers on and off.
        /// </summary>
        /// <param name="isActive">The state to which the input managers are set.</param>
        private void ToggleInput(bool isActive)
        {
            LazyLoadInputModules();

            if (m_InputModules == null)
            {
                return;
            }
            int length = m_InputModules.Length;

            for (int i = 0; i < length; i++)
            {
                TankInputModule inputModule = m_InputModules[i];
                if (inputModule != null)
                {
                    inputModule.enabled = isActive;

                    if (isActive)
                    {
                        TankTouchInput touchInput = inputModule as TankTouchInput;

                        if (touchInput != null)
                        {
                            touchInput.InitDirectionAndSize();
                            touchInput.OnStartAuthority();
                        }
                    }
                }
            }
        }
Beispiel #2
0
 protected void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").transform;
     Input  = player.GetComponent <TankInputModule>();
 }