Beispiel #1
0
    /// <summary>
    /// Spawns a ball and triggers GameEventManager.OnNewBall event
    /// </summary>
    public void SpawnBall()
    {
        // create first ball.
        GameObject ballGO = GameObject.Instantiate(BallPrefab);

        // trigger event
        EventMngr.BroadcastBallSpawnEvent(ballGO.GetComponent <PingPongBall>());
    }