protected override void Awake()
        {
            base.Awake();

            _linkedJoystick = GetComponent <SimpleJoystick>();
            _linkedJoystick.CurrentEventCamera = UiRootCamera;
        }
예제 #2
0
        protected override void Awake()
        {
            base.Awake();

            _linkedJoystick = GetComponent<SimpleJoystick>();
            _linkedJoystick.CurrentEventCamera = UiRootCamera;
        }
예제 #3
0
        private void Awake()
        {
            instanceOfSimpleJoystick = this;

            /*for (int i = 0; i < Player.Length; i++)
             * {
             *      if (PlayerPrefs.GetInt ("player") == i)
             *      {
             *              Player [i].SetActive (true);
             *              anim = Player [i].GetComponent<Animation> ();
             *      } else
             *      {
             *              Player [i].SetActive (false);
             *      }
             * }*/
            _stickTransform = Stick.GetComponent <RectTransform>();
            _baseTransform  = JoystickBase.GetComponent <RectTransform>();

            _initialStickPosition      = _stickTransform.anchoredPosition;
            _intermediateStickPosition = _initialStickPosition;
            _initialBasePosition       = _baseTransform.anchoredPosition;

            _stickTransform.anchoredPosition = _initialStickPosition;
            _baseTransform.anchoredPosition  = _initialBasePosition;

            _oneOverMovementRange = 1f / MovementRange;

            if (HideOnRelease)
            {
                Hide(true);
            }
        }
예제 #4
0
        protected override void Awake()
        {
            base.Awake();

            _linkedJoystick = GetComponent <SimpleJoystick>();
            _linkedJoystick.CurrentEventCamera = UiRootCamera;
            _joystickTouchRect = _linkedJoystick.GetComponent <RectTransform>();
        }
예제 #5
0
        void Awake()
        {
            buttonTransform       = gameObject.GetComponent(typeof(RectTransform)) as RectTransform;
            buttonAnchoredPos     = buttonTransform.anchoredPosition;
            simpleJoystickScript  = FindObjectOfType <SimpleJoystick>();
            referenceScreenHeight = simpleJoystickScript.referenceScreenHeight;

            Vector2 buttonTransformPos = buttonTransform.sizeDelta;

            ratioWidth    = buttonTransformPos.x / referenceScreenHeight;
            ratioAnchPosX = buttonAnchoredPos.x / referenceScreenHeight;
            ratioAnchPosY = buttonAnchoredPos.y / referenceScreenHeight;
        }
        protected override void Awake()
        {
            base.Awake();

            _linkedJoystick = GetComponent<SimpleJoystick>();
            _linkedJoystick.CurrentEventCamera = UiRootCamera;
            _joystickTouchRect = _linkedJoystick.GetComponent<RectTransform>();
        }