/// <summary>
        /// This will be called on clients to display combat texts
        /// </summary>
        /// <param name="combatAmountType"></param>
        /// <param name="amount"></param>
        protected void NetFuncCombatAmount(byte byteCombatAmountType, int amount)
        {
            UISceneGameplay uiSceneGameplay = UISceneGameplay.Singleton;

            if (uiSceneGameplay == null)
            {
                return;
            }
            uiSceneGameplay.SpawnCombatText(CombatTextTransform, (CombatAmountType)byteCombatAmountType, amount);
        }
        private void UpdateStorageUIVisibility(bool initData)
        {
            if (!IsOwningCharacter())
            {
                if (initData || isStorageDialogAppeared)
                {
                    isStorageDialogAppeared = false;
                    if (onStorageDialogDisappear != null)
                    {
                        onStorageDialogDisappear.Invoke();
                    }
                }
                return;
            }
            // Check visible item dialog
            UISceneGameplay uiGameplay          = UISceneGameplay.Singleton;
            bool            isAnyStorageVisible =
                (uiGameplay.uiPlayerStorageItems != null && uiGameplay.uiPlayerStorageItems.IsVisible()) ||
                (uiGameplay.uiGuildStorageItems != null && uiGameplay.uiGuildStorageItems.IsVisible()) ||
                (uiGameplay.uiBuildingStorageItems != null && uiGameplay.uiBuildingStorageItems.IsVisible());

            if (isAnyStorageVisible &&
                InventoryType == InventoryType.NonEquipItems)
            {
                if (initData || !isStorageDialogAppeared)
                {
                    isStorageDialogAppeared = true;
                    if (onStorageDialogAppear != null)
                    {
                        onStorageDialogAppear.Invoke();
                    }
                }
            }
            else
            {
                if (initData || isStorageDialogAppeared)
                {
                    isStorageDialogAppeared = false;
                    if (onStorageDialogDisappear != null)
                    {
                        onStorageDialogDisappear.Invoke();
                    }
                }
            }
        }
        private void UpdateShopUIVisibility(bool initData)
        {
            if (!IsOwningCharacter())
            {
                if (initData || isSellItemDialogAppeared)
                {
                    isSellItemDialogAppeared = false;
                    if (onNpcSellItemDialogDisappear != null)
                    {
                        onNpcSellItemDialogDisappear.Invoke();
                    }
                }
                return;
            }
            // Check visible item dialog
            UISceneGameplay uiGameplay = UISceneGameplay.Singleton;

            if (uiGameplay.uiNpcDialog != null &&
                uiGameplay.uiNpcDialog.IsVisible() &&
                uiGameplay.uiNpcDialog.Data != null &&
                uiGameplay.uiNpcDialog.Data.type == NpcDialogType.Shop &&
                InventoryType == InventoryType.NonEquipItems)
            {
                if (initData || !isSellItemDialogAppeared)
                {
                    isSellItemDialogAppeared = true;
                    if (onNpcSellItemDialogAppear != null)
                    {
                        onNpcSellItemDialogAppear.Invoke();
                    }
                }
            }
            else
            {
                if (initData || isSellItemDialogAppeared)
                {
                    isSellItemDialogAppeared = false;
                    if (onNpcSellItemDialogDisappear != null)
                    {
                        onNpcSellItemDialogDisappear.Invoke();
                    }
                }
            }
        }
        private void UpdateEnhanceSocketUIVisibility(bool initData)
        {
            if (!IsOwningCharacter())
            {
                if (initData || isEnhanceSocketItemDialogAppeared)
                {
                    isEnhanceSocketItemDialogAppeared = false;
                    if (onEnhanceSocketItemDialogDisappear != null)
                    {
                        onEnhanceSocketItemDialogDisappear.Invoke();
                    }
                }
                return;
            }
            // Check visible item dialog
            UISceneGameplay uiGameplay = UISceneGameplay.Singleton;

            if (uiGameplay.uiEnhanceSocketItem != null &&
                uiGameplay.uiEnhanceSocketItem.IsVisible() &&
                Data.characterItem.GetEquipmentItem() != null &&
                InventoryType == InventoryType.NonEquipItems)
            {
                if (initData || !isEnhanceSocketItemDialogAppeared)
                {
                    isEnhanceSocketItemDialogAppeared = true;
                    if (onEnhanceSocketItemDialogAppear != null)
                    {
                        onEnhanceSocketItemDialogAppear.Invoke();
                    }
                }
            }
            else
            {
                if (initData || isEnhanceSocketItemDialogAppeared)
                {
                    isEnhanceSocketItemDialogAppeared = false;
                    if (onEnhanceSocketItemDialogDisappear != null)
                    {
                        onEnhanceSocketItemDialogDisappear.Invoke();
                    }
                }
            }
        }
        private void UpdateDealingState(bool initData)
        {
            if (!IsOwningCharacter())
            {
                if (initData || isDealingStateEntered)
                {
                    isDealingStateEntered = false;
                    if (onExitDealingState != null)
                    {
                        onExitDealingState.Invoke();
                    }
                }
                return;
            }
            // Check visible dealing dialog
            UISceneGameplay uiGameplay = UISceneGameplay.Singleton;

            if (uiGameplay.uiDealing.IsVisible() &&
                uiGameplay.uiDealing.dealingState == DealingState.Dealing &&
                InventoryType == InventoryType.NonEquipItems)
            {
                if (initData || !isDealingStateEntered)
                {
                    isDealingStateEntered = true;
                    if (onEnterDealingState != null)
                    {
                        onEnterDealingState.Invoke();
                    }
                }
            }
            else
            {
                if (initData || isDealingStateEntered)
                {
                    isDealingStateEntered = false;
                    if (onExitDealingState != null)
                    {
                        onExitDealingState.Invoke();
                    }
                }
            }
        }
        public void OnClickSetEnhanceSocketItem()
        {
            // Only owning character can refine item
            if (!IsOwningCharacter())
            {
                return;
            }

            UISceneGameplay uiGameplay = UISceneGameplay.Singleton;

            if (uiGameplay.uiEnhanceSocketItem != null &&
                CharacterItem.GetEquipmentItem() != null)
            {
                uiGameplay.uiEnhanceSocketItem.Data = new CharacterItemByIndexTuple(InventoryType, IndexOfData);
                uiGameplay.uiEnhanceSocketItem.Show();
                if (selectionManager != null)
                {
                    selectionManager.DeselectSelectedUI();
                }
            }
        }
 private void Awake()
 {
     Singleton = this;
     MigrateNewUIs();
 }
Exemple #8
0
 private void Awake()
 {
     Singleton = this;
 }