private int rightSideFingerID = 0; // unique finger id for touches on the right-side half of the screen void Start() { if (leftJoystickBackgroundImage.GetComponent <LeftJoystick>() == null) { Debug.LogError("There is no LeftJoystick script attached to the Left Joystick game object."); } else { leftJoystick = leftJoystickBackgroundImage.GetComponent <LeftJoystick>(); // gets the left joystick script leftJoystickBackgroundImage.enabled = leftJoystickAlwaysVisible; // sets left joystick background image to be always visible or not } if (leftJoystick.transform.GetChild(0).GetComponent <Image>() == null) { Debug.LogError("There is no left joystick handle image attached to this script."); } else { leftJoystickHandleImage = leftJoystick.transform.GetChild(0).GetComponent <Image>(); // gets the handle (knob) image of the left joystick leftJoystickHandleImage.enabled = leftJoystickAlwaysVisible; // sets left joystick handle (knob) image to be always visible or not } if (rightJoystickBackgroundImage.GetComponent <RightJoystick>() == null) { Debug.LogError("There is no RightJoystick script attached to Right Joystick game object."); } else { rightJoystick = rightJoystickBackgroundImage.GetComponent <RightJoystick>(); // gets the right joystick script rightJoystickBackgroundImage.enabled = rightJoystickAlwaysVisible; // sets right joystick background image to be always visible or not } if (rightJoystick.transform.GetChild(0).GetComponent <Image>() == null) { Debug.LogError("There is no right joystick handle attached to this script."); } else { rightJoystickHandleImage = rightJoystick.transform.GetChild(0).GetComponent <Image>(); // gets the handle (knob) image of the right joystick rightJoystickHandleImage.enabled = rightJoystickAlwaysVisible; // sets right joystick handle (knob) image to be always visible or not } }