void Start() { thisRigidbody = GetComponent <Rigidbody2D>(); thisSpring = GetComponent <SpringJoint2D>(); slingRigidbody = thisSpring.connectedBody; catapultCoursor = slingRigidbody.gameObject.GetComponentInParent <CatapultCoursor>(); DelayToRelease = 1 / (thisSpring.frequency * 5); myCatapult = GetComponentInParent <Cathapult>(); }
private void Reload() { Cathapult cathapult = slingRigidbody.gameObject.GetComponentInParent <Cathapult>(); cathapult.LoadProjectile(); }