// Use this for initialization void Start() { ball = transform.Find("soccerball2").gameObject; InvokeRepeating("DoKick", 0f, kickDelay); handler = DoKick; GameController gc = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>(); if (gc) { gc.RegisterHandler(handler); } }
// Use this for initialization void Start() { monkeyArm = transform.Find("ArmPivot").gameObject; InvokeRepeating("DoThrow", 0f, throwRepeatDelay); GameController gc = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>(); if (gc) { handler = DoThrow; gc.RegisterHandler(handler); } }