void Start() { ballParent = (BallParent)FindObjectOfType(typeof(BallParent)); GetPallino(); originalPosition = transform.position; offset = transform.position - ball.transform.localPosition; ball.GetComponent <BallControl>().killCommandObserver += KillCommandObserver_CameraControl; ballParent.newRoundReporter += BeginNewRoundObserver_CameraControl; }
void Start() { rBody = GetComponent <Rigidbody>(); ballParent = transform.parent.GetComponent <BallParent>(); arrow = GameObject.Find("Arrow"); spaceKeyObserver += SpaceKeyHandler_BallControl; killCommandObserver += KillCommandHandler_BallControl; isDead = false; if (!collisionSphere) { collisionSphere = transform.GetChild(0).GetComponent <SphereCollider>(); } if (stopThreshold <= 0) { Debug.Log("Error, " + name + " stop threshold is less than or equal to 0"); } }