// Start is called before the first frame update void Start() { // Get the physics object that handles position/velocity rigidBody = GetComponent <Rigidbody2D>(); // Get a reference to each rotor's position relative to the drone object's position. // The torque scalar affects how much rotational inertia will occur compared to the // rotor's true position. A torque scalar of 0 will be 100% vertical thrust, and // a torque scalar approaching infinity will be 100% rotational thrust. leftRotorOffset = new Vector2( transform.GetChild(0).transform.localPosition.x *torqueScalar, transform.GetChild(0).transform.localPosition.y); rightRotorOffset = new Vector2( transform.GetChild(1).transform.localPosition.x *torqueScalar, transform.GetChild(1).transform.localPosition.y); // Store a reference to the Transform points for the landing pads leftFoot = transform.GetChild(2); leftFoot = transform.GetChild(3); // Get a reference to necessary external resources UIManager = UIManagerObject.GetComponent <InputUIManager>(); }
// ===== /// <summary> /// /// </summary> /// <param name="groupName"></param> /// <param name="key"></param> /// <param name="inputUI"></param> public void Initialise(string groupName, Key key, InputUIManager uiManager) { // keyRef = key; this.uiManager = uiManager; inputInfo = new InputUIInfo( groupName, key.name, key.keyCode.ToString() ); // editButton = GetComponentInChildren <Button>(); thisComponent = this; // keyTitle.text = inputInfo.keyTitle; keyText.text = inputInfo.keyName; }
public InputPiece(int id, GameObject inputpanel) : base(id) { uiManager = inputpanel.GetComponent <InputUIManager>(); inputPanel = inputpanel; }