Exemplo n.º 1
0
 protected void OnHotkeysOperation(LiteNetLibSyncList.Operation operation, int index)
 {
     if (CharacterEntity.IsOwnerClient && CacheUISceneGameplay != null)
     {
         CacheUISceneGameplay.UpdateHotkeys();
     }
 }
 protected void OnNonEquipItemsOperation(LiteNetLibSyncList.Operation operation, int index)
 {
     if (PlayerCharacterEntity.IsOwnerClient && CacheUISceneGameplay != null)
     {
         CacheUISceneGameplay.UpdateCharacter();
         CacheUISceneGameplay.UpdateNonEquipItems();
         CacheUISceneGameplay.UpdateHotkeys();
         CacheUISceneGameplay.UpdateQuests();
     }
 }
        protected virtual void Setup(BasePlayerCharacterEntity characterEntity)
        {
            if (characterEntity == null)
            {
                return;
            }

            // 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;

                CacheUISceneGameplay.UpdateCharacter();
                CacheUISceneGameplay.UpdateSkills();
                CacheUISceneGameplay.UpdateSummons();
                CacheUISceneGameplay.UpdateEquipItems();
                CacheUISceneGameplay.UpdateNonEquipItems();
                CacheUISceneGameplay.UpdateHotkeys();
                CacheUISceneGameplay.UpdateQuests();
            }
            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;
        }
Exemplo n.º 4
0
    protected virtual void Start()
    {
        if (CharacterEntity == null)
        {
            return;
        }

        // Instantiate Minimap camera, it will render to render texture
        if (minimapCameraPrefab != null)
        {
            CacheMinimapCameraControls        = Instantiate(minimapCameraPrefab);
            CacheMinimapCameraControls.target = CharacterTransform;
        }
        // Instantiate gameplay UI
        if (gameInstance.UISceneGameplayPrefab != null)
        {
            CacheUISceneGameplay = Instantiate(gameInstance.UISceneGameplayPrefab);
            CacheUISceneGameplay.UpdateCharacter();
            CacheUISceneGameplay.UpdateSkills();
            CacheUISceneGameplay.UpdateEquipItems();
            CacheUISceneGameplay.UpdateNonEquipItems();
            CacheUISceneGameplay.UpdateHotkeys();
            CacheUISceneGameplay.UpdateQuests();
            CharacterEntity.onShowNpcDialog += CacheUISceneGameplay.OnShowNpcDialog;
            CharacterEntity.onDead          += CacheUISceneGameplay.OnCharacterDead;
            CharacterEntity.onRespawn       += CacheUISceneGameplay.OnCharacterRespawn;
        }
        CharacterEntity.onDataIdChange           += OnDataIdChange;
        CharacterEntity.onEquipWeaponsChange     += OnEquipWeaponsChange;
        CharacterEntity.onAttributesOperation    += OnAttributesOperation;
        CharacterEntity.onSkillsOperation        += OnSkillsOperation;
        CharacterEntity.onBuffsOperation         += OnBuffsOperation;
        CharacterEntity.onEquipItemsOperation    += OnEquipItemsOperation;
        CharacterEntity.onNonEquipItemsOperation += OnNonEquipItemsOperation;
        CharacterEntity.onHotkeysOperation       += OnHotkeysOperation;
        CharacterEntity.onQuestsOperation        += OnQuestsOperation;
    }