protected override void Awake() { base.Awake(); _linkedJoystick = GetComponent <SimpleJoystick>(); _linkedJoystick.CurrentEventCamera = UiRootCamera; }
protected override void Awake() { base.Awake(); _linkedJoystick = GetComponent<SimpleJoystick>(); _linkedJoystick.CurrentEventCamera = UiRootCamera; }
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); } }
protected override void Awake() { base.Awake(); _linkedJoystick = GetComponent <SimpleJoystick>(); _linkedJoystick.CurrentEventCamera = UiRootCamera; _joystickTouchRect = _linkedJoystick.GetComponent <RectTransform>(); }
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>(); }