예제 #1
0
    private void ClearActionButtons()
    {
        SpritedStringUI buttonText     = null;
        ButtonAnimator  buttonAnimator = null;
        GameObject      buttonObject   = null;

        if (actionTexts != null)
        {
            for (int i = 0; i < actionTexts.Length; i++)
            {
                buttonText = actionTexts[i];
                if (buttonText != null)
                {
                    buttonText.Clear();
                    actionTexts[i] = null;
                }
            }
            actionTexts = null;
        }
        if (actionTextObjects != null)
        {
            for (int i = 0; i < actionTextObjects.Length; i++)
            {
                buttonObject = actionTextObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    actionTextObjects[i] = null;
                }
            }
            actionTextObjects = null;
        }
        if (actionButtons != null)
        {
            for (int i = 0; i < actionButtons.Length; i++)
            {
                buttonAnimator = actionButtons[i];
                if (buttonAnimator != null)
                {
                    buttonAnimator.Clear();
                    actionButtons[i] = null;
                }
            }
            actionButtons = null;
        }
        actionButtonTransforms = null;
        if (actionButtonObjects != null)
        {
            for (int i = 0; i < actionButtonObjects.Length; i++)
            {
                buttonObject = actionButtonObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    actionButtonObjects[i] = null;
                }
            }
            actionButtonObjects = null;
        }
    }
예제 #2
0
 private void CreateCurrentNodeMarker()
 {
     if ((optionsParentTransform != null) && (markerButtonObject == null) && (markerButtonModel != null))
     {
         markerButtonObject = Instantiate(markerButtonModel) as GameObject;
         markerButtonTrans  = markerButtonObject.GetComponent <RectTransform>();
         markerButton       = markerButtonObject.GetComponent <ButtonAnimator>();
         if ((markerButtonTrans == null) || (markerButton == null))
         {
             if (markerButton != null)
             {
                 markerButton.Clear();
                 markerButton = null;
             }
             markerButtonTrans = null;
             Destroy(markerButtonObject);
             markerButtonObject = null;
         }
         else
         {
             markerButtonTrans.SetParent(optionsParentTransform, false);
             markerButtonTrans.anchoredPosition = markerAnchoredPos;
         }
     }
 }
예제 #3
0
 protected override void ClearOptions()
 {
     if (markerButtonObject != null)
     {
         if (markerButton != null)
         {
             markerButton.Clear();
             markerButton = null;
         }
         markerButtonTrans = null;
         Destroy(markerButtonObject);
         markerButtonObject = null;
     }
     if (nodeSlotObjects != null)
     {
         for (int i = 0; i < nodeSlotObjects.Length; i++)
         {
             ClearNodeVisual(i);
         }
     }
     mapVisible = false;
 }
예제 #4
0
    private void ClearItemButtons()
    {
        SpritedStringUI buttonText     = null;
        ButtonAnimator  buttonAnimator = null;
        GameObject      buttonObject   = null;

        if (itemReturnButton != null)
        {
            itemReturnButton.Clear();
            itemReturnButton = null;
        }
        itemReturnButtonTransform = null;
        if (itemReturnButtonObject != null)
        {
            Destroy(itemReturnButtonObject);
            itemReturnButtonObject = null;
        }
        if (itemAdvanceButton != null)
        {
            itemAdvanceButton.Clear();
            itemAdvanceButton = null;
        }
        itemAdvanceButtonTransform = null;
        if (itemAdvanceButtonObject != null)
        {
            Destroy(itemAdvanceButtonObject);
            itemAdvanceButtonObject = null;
        }
        if (itemAmountComponents != null)
        {
            for (int i = 0; i < itemAmountComponents.Length; i++)
            {
                buttonText = itemAmountComponents[i];
                if (buttonText != null)
                {
                    buttonText.Clear();
                    itemAmountComponents[i] = null;
                }
            }
            itemAmountComponents = null;
        }
        itemAmountTransforms = null;
        if (itemAmountObjects != null)
        {
            for (int i = 0; i < itemAmountObjects.Length; i++)
            {
                buttonObject = itemAmountObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    itemAmountObjects[i] = null;
                }
            }
            itemAmountObjects = null;
        }
        if (itemTexts != null)
        {
            for (int i = 0; i < itemTexts.Length; i++)
            {
                buttonText = itemTexts[i];
                if (buttonText != null)
                {
                    buttonText.Clear();
                    itemTexts[i] = null;
                }
            }
            itemTexts = null;
        }
        itemTextTransforms = null;
        if (itemTextObjects != null)
        {
            for (int i = 0; i < itemTextObjects.Length; i++)
            {
                buttonObject = itemTextObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    itemTextObjects[i] = null;
                }
            }
            itemTextObjects = null;
        }
        if (itemButtons != null)
        {
            for (int i = 0; i < itemButtons.Length; i++)
            {
                buttonAnimator = itemButtons[i];
                if (buttonAnimator != null)
                {
                    buttonAnimator.Clear();
                    itemButtons[i] = null;
                }
            }
            itemButtons = null;
        }
        itemButtonTransforms = null;
        if (itemButtonObjects != null)
        {
            for (int i = 0; i < itemButtonObjects.Length; i++)
            {
                buttonObject = itemButtonObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    itemButtonObjects[i] = null;
                }
            }
            itemButtonObjects = null;
        }
        chosenItemIndex   = -1;
        checkingItemIndex = -1;
        firstItemIndex    = -1;
        lastItemIndex     = -1;
    }
예제 #5
0
    private void ClearSectionButtons()
    {
        SpritedStringUI buttonText     = null;
        ButtonAnimator  buttonAnimator = null;
        GameObject      buttonObject   = null;

        if (sectionTexts != null)
        {
            for (int i = 0; i < sectionTexts.Length; i++)
            {
                buttonText = sectionTexts[i];
                if (buttonText != null)
                {
                    buttonText.Clear();
                    sectionTexts[i] = null;
                }
            }
            sectionTexts = null;
        }
        if (sectionTextObjects != null)
        {
            for (int i = 0; i < sectionTextObjects.Length; i++)
            {
                buttonObject = sectionTextObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    sectionTextObjects[i] = null;
                }
            }
            sectionTextObjects = null;
        }
        if (sectionButtons != null)
        {
            for (int i = 0; i < sectionButtons.Length; i++)
            {
                buttonAnimator = sectionButtons[i];
                if (buttonAnimator != null)
                {
                    buttonAnimator.Clear();
                    sectionButtons[i] = null;
                }
            }
            sectionButtons = null;
        }
        sectionButtonTransforms = null;
        if (sectionButtonObjects != null)
        {
            for (int i = 0; i < sectionButtonObjects.Length; i++)
            {
                buttonObject = sectionButtonObjects[i];
                if (buttonObject != null)
                {
                    Destroy(buttonObject);
                    sectionButtonObjects[i] = null;
                }
            }
            sectionButtonObjects = null;
        }
        chosenSectionIndex = -1;
    }
예제 #6
0
    protected virtual void ClearOptions()
    {
        ButtonAnimator  optionComponent = null;
        GameObject      optionObject    = null;
        SpritedStringUI optionText      = null;

        selectedOptionComponent = null;
        optionEffects           = null;
        if (optionComponents != null)
        {
            for (int i = 0; i < optionComponents.Length; i++)
            {
                optionComponent = optionComponents[i];
                if (optionComponent != null)
                {
                    optionComponent.Clear();
                    optionComponents[i] = null;
                }
            }
            optionComponents = null;
        }
        if (optionTransforms != null)
        {
            for (int i = 0; i < optionTransforms.Length; i++)
            {
                optionTransforms[i] = null;
            }
            optionTransforms = null;
        }
        if (optionObjects != null)
        {
            for (int i = 0; i < optionObjects.Length; i++)
            {
                optionObject = optionObjects[i];
                if (optionObject != null)
                {
                    Destroy(optionObject);
                    optionObjects[i] = null;
                }
            }
            optionObjects = null;
        }
        if (optionTexts != null)
        {
            for (int i = 0; i < optionTexts.Length; i++)
            {
                optionText = optionTexts[i];
                if (optionText != null)
                {
                    optionText.Clear();
                    optionTexts[i] = null;
                }
            }
            optionTexts = null;
        }
        if (optionTextObjects != null)
        {
            for (int i = 0; i < optionTextObjects.Length; i++)
            {
                optionObject = optionTextObjects[i];
                if (optionObject != null)
                {
                    Destroy(optionObject);
                    optionTextObjects[i] = null;
                }
            }
            optionTextObjects = null;
        }
        currentValidModels              = 0;
        currentValidOptionModels        = null;
        currentValidOptionScales        = null;
        currentValidOptionChoiceEffects = null;
        currentValidOptionEventIDs      = null;
    }
예제 #7
0
 public void ClearVisualRepresentation(bool immediately)
 {
     if (!graphicsCleared)
     {
         if (overlayDark || immediately)
         {
             if (titleText != null)
             {
                 titleText.Clear();
                 titleText = null;
             }
             if (titleTextObject != null)
             {
                 Destroy(titleTextObject);
                 titleTextObject = null;
             }
             if (titleComponent != null)
             {
                 titleComponent.Clear();
                 titleComponent = null;
             }
             titleTransform = null;
             if (titleObject != null)
             {
                 Destroy(titleObject);
                 titleObject = null;
             }
             selectedQuitComponent = null;
             if (quitText != null)
             {
                 quitText.Clear();
                 quitText = null;
             }
             if (quitTextObject != null)
             {
                 Destroy(quitTextObject);
                 quitTextObject = null;
             }
             if (quitComponent != null)
             {
                 quitComponent.Clear();
                 quitComponent = null;
             }
             quitTransform = null;
             if (quitObject != null)
             {
                 Destroy(quitObject);
                 quitObject = null;
             }
             ClearOptions();
             if (optionsParent != null)
             {
                 optionsParentTransform = null;
                 Destroy(optionsParent);
                 optionsParent = null;
             }
             if (!immediately && (imageOverlayComponent != null))
             {
                 overlayFadeSpeed = -overlayFadeSpeedRef;
             }
             else
             {
                 overlayDark  = false;
                 overlayClear = true;
             }
         }
         if (overlayClear)
         {
             if (imageOverlayObject != null)
             {
                 imageOverlayComponent = null;
                 Destroy(imageOverlayObject);
                 imageOverlayObject = null;
             }
             graphicsCleared = true;
             if (immediately)
             {
                 requiringProgress    = false;
                 selectedChoiceEffect = ChoiceEffect.None;
             }
         }
     }
 }
예제 #8
0
    private bool CreateHeader()
    {
        string        buttonCaption    = null;
        RectTransform toDiscard        = null;
        Vector2       anchoredPosition = Vector2.zero;

        if (interfaceCanvasObject != null)
        {
            GameTextDatabase gameTextDatabase = GameTextDatabase.Instance;
            if ((titleModel != null) && (titleObject == null))
            {
                titleObject    = Instantiate(titleModel) as GameObject;
                titleTransform = titleObject.GetComponent <RectTransform>();
                titleComponent = titleObject.GetComponent <ButtonAnimator>();
                if ((titleTransform != null) && (titleComponent != null))
                {
                    titleTransform.SetParent(interfaceCanvasTrans, false);
                    anchoredPosition.x = (titlePositionRates.x - 0.5f) * interfaceCanvasRect.width;
                    anchoredPosition.y = (titlePositionRates.y - 0.5f) * interfaceCanvasRect.height;
                    titleTransform.anchoredPosition = anchoredPosition;
                    titleTransform.localScale       = new Vector3(titleScale.x, titleScale.y, 1f);
                    if (gameTextDatabase != null)
                    {
                        buttonCaption = gameTextDatabase.GetMenuOptionText(titleTextEffect);
                        CreateButtonText(titleTransform, buttonCaption, ref titleTextObject, ref toDiscard, ref titleText, true);
                    }
                    titleComponent.SetPressed(true);
                }
                else
                {
                    titleTransform = null;
                    if (titleComponent != null)
                    {
                        titleComponent.Clear();
                        titleComponent = null;
                    }
                    Destroy(titleObject);
                    titleObject = null;
                }
            }
            if (allowQuitOption && (quitModel != null) && (quitObject == null))
            {
                quitObject    = Instantiate(quitModel) as GameObject;
                quitTransform = quitObject.GetComponent <RectTransform>();
                quitComponent = quitObject.GetComponent <ButtonAnimator>();
                if ((quitTransform != null) && (quitComponent != null))
                {
                    quitTransform.SetParent(interfaceCanvasTrans, false);
                    anchoredPosition.x             = (quitPositionRates.x - 0.5f) * interfaceCanvasRect.width;
                    anchoredPosition.y             = (quitPositionRates.y - 0.5f) * interfaceCanvasRect.height;
                    quitTransform.anchoredPosition = anchoredPosition;
                    quitTransform.localScale       = new Vector3(quitScale.x, quitScale.y, 1f);
                    if (gameTextDatabase != null)
                    {
                        buttonCaption = gameTextDatabase.GetMenuOptionText(quitTextEffect);
                        CreateButtonText(quitTransform, buttonCaption, ref quitTextObject, ref toDiscard, ref quitText, true);
                    }
                }
                else
                {
                    quitTransform = null;
                    if (quitComponent != null)
                    {
                        quitComponent.Clear();
                        quitComponent = null;
                    }
                    Destroy(quitObject);
                    quitObject = null;
                }
            }
            return((quitObject != null) || (titleObject != null));
        }
        return(false);
    }