コード例 #1
0
 protected void OnStorageItemsOperation(LiteNetLibSyncList.Operation operation, int index)
 {
     if (PlayerCharacterEntity.IsOwnerClient && CacheUISceneGameplay != null)
     {
         CacheUISceneGameplay.UpdateStorageItems();
     }
 }
コード例 #2
0
        protected virtual void Setup(BasePlayerCharacterEntity characterEntity)
        {
            if (characterEntity == null)
            {
                return;
            }

            // Instantiate Minimap camera, it will render to render texture
            if (CacheGameplayCameraControls != null)
            {
                CacheGameplayCameraControls.target = characterEntity.CacheTransform;
            }

            // Instantiate Minimap camera, it will render to render texture
            if (CacheMinimapCameraControls != null)
            {
                CacheMinimapCameraControls.target = characterEntity.CacheTransform;
            }

            // Instantiate gameplay UI
            if (CacheUISceneGameplay != null)
            {
                characterEntity.onShowNpcDialog             += CacheUISceneGameplay.OnShowNpcDialog;
                characterEntity.onShowNpcRefine             += CacheUISceneGameplay.OnShowNpcRefine;
                characterEntity.onDead                      += CacheUISceneGameplay.OnCharacterDead;
                characterEntity.onRespawn                   += CacheUISceneGameplay.OnCharacterRespawn;
                characterEntity.onShowDealingRequestDialog  += CacheUISceneGameplay.OnShowDealingRequest;
                characterEntity.onShowDealingDialog         += CacheUISceneGameplay.OnShowDealing;
                characterEntity.onUpdateDealingState        += CacheUISceneGameplay.OnUpdateDealingState;
                characterEntity.onUpdateDealingGold         += CacheUISceneGameplay.OnUpdateDealingGold;
                characterEntity.onUpdateDealingItems        += CacheUISceneGameplay.OnUpdateDealingItems;
                characterEntity.onUpdateAnotherDealingState += CacheUISceneGameplay.OnUpdateAnotherDealingState;
                characterEntity.onUpdateAnotherDealingGold  += CacheUISceneGameplay.OnUpdateAnotherDealingGold;
                characterEntity.onUpdateAnotherDealingItems += CacheUISceneGameplay.OnUpdateAnotherDealingItems;
                characterEntity.onShowPartyInvitationDialog += CacheUISceneGameplay.OnShowPartyInvitation;
                characterEntity.onShowGuildInvitationDialog += CacheUISceneGameplay.OnShowGuildInvitation;
                characterEntity.onShowStorage               += CacheUISceneGameplay.OnShowStorage;
                characterEntity.onIsWarpingChange           += CacheUISceneGameplay.OnIsWarpingChange;

                CacheUISceneGameplay.UpdateCharacter();
                CacheUISceneGameplay.UpdateSkills();
                CacheUISceneGameplay.UpdateSummons();
                CacheUISceneGameplay.UpdateEquipItems();
                CacheUISceneGameplay.UpdateEquipWeapons();
                CacheUISceneGameplay.UpdateNonEquipItems();
                CacheUISceneGameplay.UpdateHotkeys();
                CacheUISceneGameplay.UpdateQuests();
                CacheUISceneGameplay.UpdateStorageItems();
            }
            characterEntity.onIdChange               += OnIdChange;
            characterEntity.onEquipWeaponsChange     += OnEquipWeaponsChange;
            characterEntity.onAttributesOperation    += OnAttributesOperation;
            characterEntity.onSkillsOperation        += OnSkillsOperation;
            characterEntity.onSummonsOperation       += OnSummonsOperation;
            characterEntity.onBuffsOperation         += OnBuffsOperation;
            characterEntity.onEquipItemsOperation    += OnEquipItemsOperation;
            characterEntity.onNonEquipItemsOperation += OnNonEquipItemsOperation;
            characterEntity.onHotkeysOperation       += OnHotkeysOperation;
            characterEntity.onQuestsOperation        += OnQuestsOperation;
            characterEntity.onStorageItemsOperation  += OnStorageItemsOperation;

            if (onSetup != null)
            {
                onSetup.Invoke(this);
            }
        }