Exemplo n.º 1
0
    public void CreateNewDiscoveryBubble(GameObject shape, Material color, Vector3 size)
    {
        GameObject newBubble = Instantiate(speechBubblePrefab, player.transform.position, transform.rotation, transform);

        GameObject contents = objectSpawner.CreateAndReturnThoughtObject(shape, color, size);

        contents.transform.parent = newBubble.transform;

        Vector3 discoveryObjectPosition = new Vector3(contentsPosition.x, contentsPosition.y, -1f);

        contents.transform.localPosition = discoveryObjectPosition;

        Vector3    darkSurfacePosition = new Vector3(contentsPosition.x, contentsPosition.y, -3f);
        GameObject darkSurface         = Instantiate(darkSurfacePrefab, newBubble.transform);

        darkSurface.transform.localPosition = darkSurfacePosition;

        StartCoroutine(FadeBubble(newBubble));
        activeSpeechBubbles.Enqueue(newBubble);
    }