Beispiel #1
0
        public void FillAssets(ref List <CustomAssetComponent> assets)
        {
            CustomAsset          item;
            CustomAssetComponent comp;
            KeyValueList <string, CustomAsset> cahcer;

            string bundleName;
            int    max = assets.Count;

            for (int i = 0; i < max; i++)
            {
                comp = assets[i];
                if (comp != default)
                {
                    bundleName = comp.GetBundleName();
                    cahcer     = new KeyValueList <string, CustomAsset>();
                    mAssetsCacher.Add(cahcer);

                    if (!mBundleMapper.ContainsKey(bundleName))
                    {
                        mBundleMapper[bundleName] = new List <int>();
                    }
                    int index = mAssetsCacher.Count - 1;
                    mBundleMapper[bundleName].Add(index);

                    if (comp.Assets != default)
                    {
                        int n = comp.Assets.Count;
                        for (int j = 0; j < n; j++)
                        {
                            item = comp.Assets[j];
                            cahcer[item.assetName] = item;
                        }
                    }
                }
            }
        }
        public AniStateFX GetAniStateFX(string FXName)
        {
            AniStateFX result = default;

            if (mActivedEffectMapper != default && mActivedEffectMapper.ContainsKey(FXName))
            {
                int index = mActivedEffectMapper[FXName];
                result = m_AniStateEffects[index];
            }
            else
            {
            }

            return(result);
        }
Beispiel #3
0
        public void AddSound(string name, AudioClip clip, bool isBGM = false, int groupName = int.MaxValue)
        {
            SoundInfo info;

            if (mSounds.ContainsKey(name))
            {
                info = mSounds[name];
            }
            else
            {
                info          = new SoundInfo();
                mSounds[name] = info;
            }
            info.clip      = clip;
            info.groupName = groupName;
            info.isBGM     = isBGM;
        }
Beispiel #4
0
        /// <summary>
        /// 加载框架的管理单元
        /// </summary>
        /// <param name="units"></param>
        public void LoadUnit(params IFrameworkUnit[] units)
        {
            int            max = units.Length;
            IFrameworkUnit unit;

            for (int i = 0; i < max; i++)
            {
                unit = units[i];
                if (!mUnits.ContainsKey(unit.Name))
                {
                    mUnits[unit.Name] = unit;
                }
                else
                {
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// 添加模块内环节处理器函数的委托
        /// </summary>
        public virtual void AddHandler(ref TMethodPriority target, bool willSort = false)
        {
            if (!mSourceMethodPriority.Contains(target))
            {
                TMethod method = OnHandlerGetter.Invoke(target);
                mSourceMethod.Add(method);
                mSourceMethodPriority.Add(target);

                int noticeName = target.NoticeName;
                if (mPriorities.ContainsKey(noticeName))
                {
                    mWillSorts = mPriorities[noticeName];
                }
                else
                {
                    mWillSorts = new List <TMethodPriority>();
                    mPriorities[noticeName] = mWillSorts;
                }

                mWillSorts.Add(target);

                if (willSort)
                {
                    int        max  = mPriorities.Size;
                    List <int> keys = mPriorities.Keys;
                    for (int i = 0; i < max; i++)
                    {
                        mWillSorts = mPriorities.GetValueByIndex(i);

                        //优先级排序
                        noticeName = keys[i];
                        SortHandlers(noticeName);
                        mWillSorts = default;
                    }
                }
                else
                {
                }
            }
            else
            {
            }
        }
Beispiel #6
0
        /// <inheritdoc/>
        public override void ShowInView(IHtmlView htmlView, KeyValueList <string, string> variables)
        {
            base.ShowInView(htmlView, variables);
            ISettingsService settingsService = Ioc.GetOrCreate <ISettingsService>();

            View.NavigationCompleted += NavigationCompletedEventHandler;
            _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository);

            NoteModel note;

            _startedWithSendToSilentnotes = variables.ContainsKey(ControllerParameters.SendToSilentnotesText);
            if (_startedWithSendToSilentnotes)
            {
                // Create new note and update repository
                note = new NoteModel();
                note.BackgroundColorHex = settingsService.LoadSettingsOrDefault().DefaultNoteColorHex;
                noteRepository.Notes.Insert(0, note);
                _sendToSilentnotesText = variables[ControllerParameters.SendToSilentnotesText];
            }
            else
            {
                // Get the note from the repository
                Guid noteId = new Guid(variables[ControllerParameters.NoteId]);
                note = noteRepository.Notes.Find(item => noteId == item.Id);
            }

            _viewModel = new NoteViewModel(
                Ioc.GetOrCreate <INavigationService>(),
                Ioc.GetOrCreate <ILanguageService>(),
                Ioc.GetOrCreate <ISvgIconService>(),
                Ioc.GetOrCreate <IBaseUrlService>(),
                null,
                _repositoryService,
                settingsService,
                note);

            Bindings.BindCommand("GoBack", _viewModel.GoBackCommand);
            Bindings.UnhandledViewBindingEvent += UnhandledViewBindingEventHandler;

            string html = _viewService.GenerateHtml(_viewModel);

            View.LoadHtml(html);
        }
        private void CreateAssetImporters(ref string abName, ref KeyValueList <string, List <ABAssetCreater> > mapper)
        {
            string path;
            string assetItemName;
            string relativeName;
            string starter = StringUtils.PATH_SYMBOL.Append(AppPaths.resDataRoot);

            FileInfo fileInfo;
            List <ABAssetCreater> list;
            int starterLen = starter.Length;
            int max        = ResList.Length;

            for (int i = 0; i < max; i++)
            {
                assetItemName = GetValueItem("res_" + i).Value;
                relativeName  = assetItemName.Replace("Assets/".Append(AppPaths.resDataRoot), string.Empty);
                path          = AppPaths.DataPathResDataRoot.Append(relativeName);

                fileInfo = new FileInfo(path);
                if (fileInfo.Extension == ".cs")
                {
                    continue;
                }

                int            index   = path.IndexOf(starter, StringComparison.Ordinal);
                ABAssetCreater creater = new ABAssetCreater(path.Substring(index + starterLen));
                abName = creater.GetABName();

                if (mapper.ContainsKey(abName))
                {
                    list = mapper[abName];
                }
                else
                {
                    list           = new List <ABAssetCreater>();
                    mapper[abName] = list;
                }
                creater.Importer = AssetImporter.GetAtPath(assetItemName);
                list.Add(creater);
            }
        }
        private void OnEffect(ElimlnateGrid target, TweenEffectBase <GridEffectParam> info, GridEffectParam param)
        {
            if (mRangeSigns.ContainsKey(target))
            {
                Transform trans = mRangeSigns[target].transform;
                ApplyPriviewSign(ref trans, ref target, ref param);
            }
            else
            {
                ShipDockApp.Instance.Effects.CreateEffect(RangeSignResPoolName, out GameObject effect);

                CreatePreviewSign(ref target, ref effect, ref param);

                if (effect != default)
                {
                    mRangeSigns[target] = effect;
                }
                else
                {
                }
            }
        }
        /// <summary>
        /// 处理物理检测
        /// </summary>
        /// <param name="gameItemID">中心id</param>
        /// <param name="id">已检测到的id</param>
        /// <param name="isTrigger">是否为触发器</param>
        /// <param name="isCollided">是否为碰撞器</param>
        public void OverlayChecked(int gameItemID, int id, bool isTrigger, bool isCollided)
        {
            if ((gameItemID != int.MaxValue) && mPhysicsCheckable[gameItemID])
            {
                List <int> list;
                if (mArounds.ContainsKey(gameItemID))
                {
                    list = mArounds[gameItemID];
                }
                else
                {
                    list = new List <int>();
                    mArounds[gameItemID] = list;

                    mPhysicsCheckable[gameItemID] = true;
                }
                if (!list.Contains(id))
                {
                    list.Add(id);
                    "log: BehaviourIDs overlay checked, {0} added, gameObject id = {1}".Log(id.ToString(), gameItemID.ToString());
                }
            }
        }
Beispiel #10
0
 private void OnStateFrameUpdater(IState state, bool isAdd)
 {
     if (isAdd)
     {
         if (!mStateMapper.ContainsKey(state))
         {
             MethodUpdater updater = new MethodUpdater()
             {
                 Update = state.UpdateState
             };
             mStateMapper[state] = updater;
             UpdaterNotice.AddSceneUpdater(updater);
         }
         else
         {
         }
     }
     else
     {
         IUpdate updater = mStateMapper.GetValue(state, true);
         UpdaterNotice.RemoveSceneUpdater(updater);
     }
 }
Beispiel #11
0
        private void Button_ClickAdd(object sender, RoutedEventArgs e)
        {
            if (ComboBox_SelectLanguage.SelectedValue != null)
            {
                string key = GetLanguageKey();
                if (!_currentLanuage.ContainsKey(key))
                {
                    KeyValue kv = new KeyValue();
                    kv.key = key;
                    CurrentLanuage.Add(kv);

                    CurrentLanuage = CurrentLanuage;
                }
                else
                {
                    MessageBox.Show("已存在的语言 " + key);
                }
            }
            else
            {
                MessageBox.Show("请选择语言 ");
            }
        }
Beispiel #12
0
 private void OnFSMFrameUpdater(IStateMachine fsm, bool isAdd)
 {
     if (isAdd)
     {
         if (!mFSMUpdaters.ContainsKey(fsm))
         {
             MethodUpdater updater = new MethodUpdater
             {
                 Update = fsm.UpdateState
             };
             mFSMUpdaters[fsm] = updater;
             UpdaterNotice.AddSceneUpdater(updater);
         }
         else
         {
         }
     }
     else
     {
         IUpdate updater = mFSMUpdaters.GetValue(fsm, true);
         UpdaterNotice.RemoveSceneUpdater(updater);
     }
 }
Beispiel #13
0
        /// <summary>
        /// 检测物体四周目标
        /// </summary>
        private void CheckAround(ref IShipDockEntitas target)
        {
            if (!mBehaviourIdsCompChecked)
            {
                mBehaviourIdsCompChecked = true;
                mHasBehaviourIDs         = BehaviourIDsComp != default;
            }

            if (mHasBehaviourIDs && IsWorldItemValid(ref mWorldItem))
            {
                BehaviourIDs ids      = BehaviourIDsComp.GetEntitasData(ref target);
                int          aroundID = ids.gameItemID;
                if (mAroundMapper.ContainsKey(aroundID))
                {
                    WalkEachAroundItem(ref target, ids);
                }
                else
                {
                    mWorldItem.aroundID     = aroundID;
                    mAroundMapper[aroundID] = mMovement;
                }
            }
        }
        protected void AddNotifies(Action <INoticeBase <int> > method, bool inherit = false)
        {
            if (!mModularNotifierMapper.ContainsKey(method))
            {
                mModularAttributes     = method.Method.GetCustomAttributes(mNoticeNotifyAttributeType, inherit);
                mNoticeNotifyAttribute = mModularAttributes != default ? mModularAttributes[0] as ModularNotifyAttribute : default;
                if (mNoticeNotifyAttribute != default)
                {
                    mModularNotifierMapper[method] = new ModularNotifier(mNoticeNotifyAttribute.Notices)
                    {
                        NotifyTiming = mNoticeNotifyAttribute.NotifyTiming,
                    };
                }
                else
                {
                }
            }
            else
            {
            }

            mNoticeNotifyAttribute = default;
            mModularAttributes     = default;
        }
Beispiel #15
0
 public bool HasDataUnit(int key)
 {
     return(mStorager.ContainsKey(key));
 }
Beispiel #16
0
 public bool HasBundel(string name)
 {
     return((mCaches != default) && mCaches.ContainsKey(name));
 }
Beispiel #17
0
 public bool HasEffectRaw(int id)
 {
     return(mPrefabRaw.ContainsKey(id));
 }
Beispiel #18
0
 public bool HasConfigGroup(int name)
 {
     return(mConfigs != default && mConfigs.ContainsKey(name));
 }
Beispiel #19
0
 /// <summary>
 /// 判定指定实体是否包含有组件数据
 /// </summary>
 public bool HasEntitasData <E>(ref E target) where E : IShipDockEntitas
 {
     return(mDatas.ContainsKey(target));
 }
Beispiel #20
0
        /// <inheritdoc/>
        public override void ShowInView(IHtmlView htmlView, KeyValueList <string, string> variables, Navigation redirectedFrom)
        {
            base.ShowInView(htmlView, variables, redirectedFrom);
            ISettingsService settingsService = Ioc.GetOrCreate <ISettingsService>();

            _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository);

            NoteModel note;

            variables.TryGetValue(ControllerParameters.SearchFilter, out _startingSearchFilter);
            _startedWithSendToSilentnotes = variables.ContainsKey(ControllerParameters.SendToSilentnotesText);
            if (_startedWithSendToSilentnotes)
            {
                // Create new note and update repository
                note = new NoteModel();
                note.BackgroundColorHex = settingsService.LoadSettingsOrDefault().DefaultNoteColorHex;
                noteRepository.Notes.Insert(0, note);
                _sendToSilentnotesText = variables[ControllerParameters.SendToSilentnotesText];
            }
            else
            {
                // Get the note from the repository
                Guid noteId = new Guid(variables[ControllerParameters.NoteId]);
                note = noteRepository.Notes.FindById(noteId);
            }

            ICryptor cryptor = new Cryptor(NoteModel.CryptorPackageName, Ioc.GetOrCreate <ICryptoRandomService>());

            _viewModel = new NoteViewModel(
                Ioc.GetOrCreate <INavigationService>(),
                Ioc.GetOrCreate <ILanguageService>(),
                Ioc.GetOrCreate <ISvgIconService>(),
                Ioc.GetOrCreate <IThemeService>(),
                Ioc.GetOrCreate <IBaseUrlService>(),
                null,
                _repositoryService,
                Ioc.GetOrCreate <IFeedbackService>(),
                settingsService,
                cryptor,
                noteRepository.Safes,
                note);
            SetHtmlViewBackgroundColor(htmlView);

            VueBindingShortcut[] shortcuts = new[]
            {
                new VueBindingShortcut("f", "ToggleSearchDialogCommand")
                {
                    Ctrl = true
                },
                new VueBindingShortcut(VueBindingShortcut.KeyEscape, "CloseSearchDialogCommand"),
                new VueBindingShortcut(VueBindingShortcut.KeyHome, "ScrollToTop")
                {
                    Ctrl = true
                },
                new VueBindingShortcut(VueBindingShortcut.KeyEnd, "ScrollToBottom")
                {
                    Ctrl = true
                },
            };
            VueBindings = new VueDataBinding(_viewModel, View, shortcuts);
            VueBindings.DeclareAdditionalVueData("PrettyTimeAgoVisible", "true");
            VueBindings.DeclareAdditionalVueData("Header1Active", "false");
            VueBindings.DeclareAdditionalVueData("Header2Active", "false");
            VueBindings.DeclareAdditionalVueData("Header3Active", "false");
            VueBindings.DeclareAdditionalVueData("ListOrderedActive", "false");
            VueBindings.DeclareAdditionalVueData("ListBulletActive", "false");
            VueBindings.DeclareAdditionalVueData("CodeActive", "false");
            VueBindings.DeclareAdditionalVueData("QuoteActive", "false");
            VueBindings.DeclareAdditionalVueData("UnderlineActive", "false");
            VueBindings.DeclareAdditionalVueData("StrikeActive", "false");
            VueBindings.DeclareAdditionalVueMethod("ToggleSearchDialogCommand", "toggleSearchDialog();");
            VueBindings.DeclareAdditionalVueMethod("CloseSearchDialogCommand", "showSearchDialog(false);");
            VueBindings.DeclareAdditionalVueMethod("ScrollToTop", "scrollToTop();");
            VueBindings.DeclareAdditionalVueMethod("ScrollToBottom", "scrollToBottom();");
            VueBindings.UnhandledViewBindingEvent += UnhandledViewBindingEventHandler;
            VueBindings.ViewLoadedEvent           += ViewLoadedEventHandler;
            _viewModel.VueDataBindingScript        = VueBindings.BuildVueScript();
            VueBindings.StartListening();

            string html = _viewService.GenerateHtml(_viewModel);

            View.LoadHtml(html);
        }
Beispiel #21
0
 public List <int> GetEmptyCountInCol(int col)
 {
     return(mGridsEmpty.ContainsKey(col) ? mGridsEmpty[col] : new List <int>());
 }
Beispiel #22
0
 public int GetRigidbody(ref ICommonRole target)
 {
     return(mRigidbodySubgourp.ContainsKey(target) ? mRigidbodySubgourp[target] : default);