Ejemplo n.º 1
0
 private VisualEffectsController()
 {
     effectObjects = null;
     effects       = null;
     baseZ         = DisplayDepthManager.GetElementDepth(DisplayDepthManager.ELEMENT_CODE_VFX);
     offsetZ       = DisplayDepthManager.ELEMENT_TO_ELEMENT_OFFSET / MAX_EFFECTS_IN_LAYER;
 }
Ejemplo n.º 2
0
    private TransactionBoxManager()
    {
        transactionBoxParent = null;
        boxObjects           = null;
        boxComponents        = null;
        boxSourceObjects     = null;
        boxSourceListeners   = null;
        boxSourceDistances   = null;
        boxTryAboves         = null;
        boxTailObjects       = null;
        boxTailRenderers     = null;
        symbolDatabase       = null;
        boxDatabase          = null;
        boxAppearanceIndex   = -1;
        bodySprite           = null;
        tailSprite           = null;
        tailWidth            = 0f;
        tailHeight           = 0f;
        tailHalfWidth        = 0f;
        tailHalfHeight       = 0f;
        cameraObject         = null;
        cameraController     = null;
        cameraWidth          = 0f;
        cameraHeight         = 0f;
        cameraHalfWidth      = 0f;
        cameraHalfHeight     = 0f;
        boxDepth             = DisplayDepthManager.GetElementDepth(DisplayDepthManager.ELEMENT_CODE_TRANSACTION);
        boxLimits            = new Vector2(TextBox.DEFAULT_MAX_BOX_WIDTH, TextBox.DEFAULT_MAX_BOX_HEIGHT);

        transactionBoxParent = new GameObject("TransactionBoxParent");
        transactionBoxParent.transform.position = new Vector3(0f, 0f, boxDepth);
    }
Ejemplo n.º 3
0
    private TextBoxManager()
    {
        textBoxParent      = null;
        boxObjects         = null;
        boxComponents      = null;
        boxMasterEvents    = null;
        boxQuestionRoles   = null;
        boxOptionIndexes   = null;
        boxSpeakerIDs      = null;
        boxTryAboves       = null;
        boxTailObjects     = null;
        boxTailRenderers   = null;
        symbolDatabase     = null;
        boxDatabase        = null;
        boxAppearanceIndex = -1;
        bodySpriteSystem   = null;
        bodySpriteDialogue = null;
        tailSpriteDialogue = null;
        tailWidth          = 0f;
        tailHeight         = 0f;
        tailHalfWidth      = 0f;
        tailHalfHeight     = 0f;
        stage                  = null;
        cameraObject           = null;
        cameraController       = null;
        cameraWidth            = 0f;
        cameraHeight           = 0f;
        cameraHalfWidth        = 0f;
        cameraHalfHeight       = 0f;
        cameraPixelWidth       = 0;
        cameraPixelHeight      = 0;
        boxDepth               = DisplayDepthManager.GetElementDepth(DisplayDepthManager.ELEMENT_CODE_TEXT);
        systemBoxLimits        = new Vector2(TextBox.DEFAULT_MAX_BOX_WIDTH, TextBox.DEFAULT_MAX_BOX_HEIGHT);
        systemBoxTopOffset     = 0f;
        dialogueBoxLimits      = new Vector2(DialogueBox.DEFAULT_MAX_D_BOX_WIDTH, DialogueBox.DEFAULT_MAX_D_BOX_HEIGHT);
        questionDelegate       = null;
        enunciateBoxTopOffset  = 0f;
        enunciateBoxComponent  = null;
        optionsToAllocate      = 0;
        optionAreaHeight       = 0f;
        optionHalfAreaHeight   = 0f;
        optionBoxTopOffset     = 0f;
        optionAwaitedIndex     = -1;
        optionChosenIndex      = -1;
        optionIndexConfirm     = -1;
        optionIndexCancel      = -1;
        optionComponentConfirm = null;
        optionComponentCancel  = null;
        paused                 = false;

        textBoxParent = new GameObject("TextBoxParent");
        textBoxParent.transform.position = new Vector3(0f, 0f, boxDepth);
    }
Ejemplo n.º 4
0
    private bool AddPlane(Sprite planeSprite, float cameraConnection, bool planeContinuity, float planeSpeed)
    {
        int        planeIndex     = -1;
        float      planeDepth     = 0f;
        float      spriteWidth    = 0f;
        float      spriteHeight   = 0f;
        int        spriteRows     = 0;
        int        spriteColumns  = 0;
        int        spriteTotal    = 0;
        GameObject newPlaneObject = null;

        GameObject[]   newPlaneObjects  = null;
        SpriteRenderer newPlaneRenderer = null;

        SpriteRenderer[] newPlaneRenderers = null;

        if ((planeSprite == null) || !cameraDimensionsValid || (cameraController == null) || (backgroundParent == null))
        {
            return(false);
        }
        cameraConnection = (cameraConnection < 0f ? 0f : cameraConnection);
        cameraConnection = (cameraConnection > 1f ? 1f : cameraConnection);
        planeIndex       = totalPlanes;
        totalPlanes++;
        UsefulFunctions.IncreaseArray <Sprite>(ref planeSprites, planeSprite);
        UsefulFunctions.IncreaseArray <float>(ref planeCameraConnections, cameraConnection);
        UsefulFunctions.IncreaseArray <bool>(ref planeContinuities, planeContinuity);
        UsefulFunctions.IncreaseArray <float>(ref planeSpeeds, planeSpeed);

        /*halmeida - need to find out how many times I must repeat the sprite across the screen to cover it.*/
        spriteWidth = planeSprite.bounds.size.x;
        if (!planeContinuity)
        {
            spriteColumns = 1;
            spriteRows    = 1;
        }
        else
        {
            if (spriteWidth >= cameraMaxWorldWidth)
            {
                spriteColumns = 2;
            }
            else
            {
                spriteColumns  = (int)(cameraMaxWorldWidth / spriteWidth);
                spriteColumns += 2;
            }
            spriteHeight = planeSprite.bounds.size.y;
            if (spriteHeight >= cameraMaxWorldHeight)
            {
                spriteRows = 2;
            }
            else
            {
                spriteRows  = (int)(cameraMaxWorldHeight / spriteHeight);
                spriteRows += 2;
            }
        }
        spriteTotal = spriteRows * spriteColumns;
        UsefulFunctions.IncreaseArray <int>(ref planeObjectRows, spriteRows);
        UsefulFunctions.IncreaseArray <int>(ref planeObjectColumns, spriteColumns);
        UsefulFunctions.IncreaseArray <int>(ref planeObjectTotals, spriteTotal);
        planeDepth = DisplayDepthManager.GetElementDepth(DisplayDepthManager.ELEMENT_CODE_BACKGROUND + planeIndex);
        for (int i = 0; i < spriteTotal; i++)
        {
            newPlaneObject = new GameObject("BGPlane" + planeIndex + "Object" + i);
            newPlaneObject.transform.SetParent(backgroundParent.transform, false);
            newPlaneObject.transform.localPosition = new Vector3(backgroundOriginPoint.x, backgroundOriginPoint.y, planeDepth);
            newPlaneRenderer        = newPlaneObject.AddComponent <SpriteRenderer>();
            newPlaneRenderer.sprite = planeSprite;
            UsefulFunctions.IncreaseArray <GameObject>(ref newPlaneObjects, newPlaneObject);
            UsefulFunctions.IncreaseArray <SpriteRenderer>(ref newPlaneRenderers, newPlaneRenderer);
        }
        UsefulFunctions.IncreaseArray <GameObject[]>(ref planeObjects, newPlaneObjects);
        UsefulFunctions.IncreaseArray <SpriteRenderer[]>(ref planeRenderers, newPlaneRenderers);
        return(true);
    }