Exemplo n.º 1
0
    public void SpawnBall(string id, BallData bd)
    {
        Ball newBall = Instantiate(ballPrefab, propsContainer.transform).GetComponent <Ball>();

        newBall.transform.position = new Vector3(bd.position.x, bd.position.y, bd.position.z);
        newBall.transform.rotation = new Quaternion(bd.rotation.x, bd.rotation.y, bd.rotation.z, bd.rotation.w);
        newBall.SetPositionTarget(new Vector3(bd.position.x, bd.position.y, bd.position.z));
        newBall.SetRotationTarget(new Quaternion(bd.rotation.x, bd.rotation.y, bd.rotation.z, bd.rotation.w));
        balls.Add(id, newBall);
        ballSpawner.PlaySpawnSound();
    }