示例#1
0
    public void SetMaterials(SymbolDatabase newSymbolDatabase, BoxAppearanceDatabase newBoxDatabase)
    {
        Sprite bodySprite = null;
        Sprite tailSprite = null;

        symbolDatabase = newSymbolDatabase;
        boxDatabase    = newBoxDatabase;
        if (boxDatabase != null)
        {
            if (!boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.System, 0, ref bodySprite, ref tailSprite))
            {
                boxAppearanceIndex = -1;
                bodySpriteSystem   = null;
                bodySpriteDialogue = null;
                tailSpriteDialogue = null;
            }
            else
            {
                boxAppearanceIndex = 0;
                bodySpriteSystem   = bodySprite;
                boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.Dialogue, 0, ref bodySprite, ref tailSprite);
                bodySpriteDialogue = bodySprite;
                tailSpriteDialogue = tailSprite;
            }
        }
        ExtractTailDimensions();
    }
示例#2
0
    public void AdvanceBoxAppearance()
    {
        Sprite    tailSprite   = null;
        int       newIndex     = -1;
        TextBoxUI boxComponent = null;

        if ((boxDatabase != null) && (boxAppearanceIndex > -1))
        {
            newIndex = boxAppearanceIndex++;
            if (!boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.UI, newIndex, ref bodySprite, ref tailSprite))
            {
                newIndex = 0;
                boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.UI, newIndex, ref bodySprite, ref tailSprite);
            }
            boxAppearanceIndex = newIndex;
            if (boxComponents != null)
            {
                for (int i = 0; i < boxComponents.Length; i++)
                {
                    boxComponent = boxComponents[i];
                    if (boxComponent != null)
                    {
                        boxComponent.ChangeBoxBody(bodySprite);
                    }
                }
            }
        }
    }
示例#3
0
    public void AdvanceBoxAppearance()
    {
        Sprite         bodySprite   = null;
        Sprite         tailSprite   = null;
        int            newIndex     = -1;
        int            boxSpeakerID = BaseAgent.INVALID_AGENT_ID;
        TextBox        boxComponent = null;
        SpriteRenderer tailRenderer = null;

        if ((boxDatabase != null) && (boxAppearanceIndex > -1))
        {
            newIndex = boxAppearanceIndex++;
            if (!boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.System, newIndex, ref bodySprite, ref tailSprite))
            {
                newIndex = 0;
                boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.System, newIndex, ref bodySprite, ref tailSprite);
            }
            boxAppearanceIndex = newIndex;
            bodySpriteSystem   = bodySprite;
            boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.Dialogue, newIndex, ref bodySprite, ref tailSprite);
            bodySpriteDialogue = bodySprite;
            tailSpriteDialogue = tailSprite;
            ExtractTailDimensions();
            if (boxComponents != null)
            {
                for (int i = 0; i < boxComponents.Length; i++)
                {
                    boxComponent = boxComponents[i];
                    if (boxComponent != null)
                    {
                        /*halmeida - relying on the coherence of all box related arrays.*/
                        boxSpeakerID = boxSpeakerIDs[i];
                        if (boxSpeakerID == BaseAgent.INVALID_AGENT_ID)
                        {
                            boxComponent.ChangeBoxBody(bodySpriteSystem);
                        }
                        else
                        {
                            boxComponent.ChangeBoxBody(bodySpriteDialogue);
                        }
                    }
                }
            }
            if (boxTailRenderers != null)
            {
                for (int i = 0; i < boxTailRenderers.Length; i++)
                {
                    tailRenderer = boxTailRenderers[i];
                    if (tailRenderer != null)
                    {
                        tailRenderer.sprite = tailSpriteDialogue;
                    }
                }
            }
        }
    }
示例#4
0
    public void AdvanceBoxAppearance()
    {
        int            newIndex     = -1;
        TransactionBox boxComponent = null;
        SpriteRenderer tailRenderer = null;

        if ((boxDatabase != null) && (boxAppearanceIndex > -1))
        {
            newIndex = boxAppearanceIndex++;
            if (!boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.System, newIndex, ref bodySprite, ref tailSprite))
            {
                newIndex = 0;
                boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.System, newIndex, ref bodySprite, ref tailSprite);
            }
            boxAppearanceIndex = newIndex;
            ExtractTailDimensions();
            if (boxComponents != null)
            {
                for (int i = 0; i < boxComponents.Length; i++)
                {
                    boxComponent = boxComponents[i];
                    if (boxComponent != null)
                    {
                        boxComponent.ChangeBoxBody(bodySprite);
                    }
                }
            }
            if (boxTailRenderers != null)
            {
                for (int i = 0; i < boxTailRenderers.Length; i++)
                {
                    tailRenderer = boxTailRenderers[i];
                    if (tailRenderer != null)
                    {
                        tailRenderer.sprite = tailSprite;
                    }
                }
            }
        }
    }
示例#5
0
    public void SetMaterials(SymbolDatabase newSymbolDatabase, BoxAppearanceDatabase newBoxDatabase)
    {
        Sprite tailSprite = null;

        symbolDatabase = newSymbolDatabase;
        boxDatabase    = newBoxDatabase;
        if (boxDatabase != null)
        {
            if (!boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.UI, 0, ref bodySprite, ref tailSprite))
            {
                boxAppearanceIndex = -1;
                bodySprite         = null;
            }
            else
            {
                boxAppearanceIndex = 0;
            }
        }
    }
示例#6
0
 public void SetMaterials(SymbolDatabase newSymbolDatabase, BoxAppearanceDatabase newBoxDatabase)
 {
     symbolDatabase = newSymbolDatabase;
     boxDatabase    = newBoxDatabase;
     if (boxDatabase != null)
     {
         if (!boxDatabase.GetBoxAppearance(BoxAppearanceDatabase.BoxPurpose.Transaction, 0, ref bodySprite, ref tailSprite))
         {
             boxAppearanceIndex = -1;
             bodySprite         = null;
             tailSprite         = null;
         }
         else
         {
             boxAppearanceIndex = 0;
             ExtractTailDimensions();
         }
     }
 }