コード例 #1
0
 void OnAddCellMapping()
 {
     CellMappings.Add(new CellMappingDeclaration()
     {
         HighlightColor = TextureParserExtensions.Colors[CellMappings.Count % TextureParserExtensions.Colors.Count]
     });
 }
コード例 #2
0
        void OnRemoveCellMapping(CellMappingDeclaration?d)
        {
            if (d == null)
            {
                return;
            }

            CellMappings.Remove(d);
        }
コード例 #3
0
        public bool TryGetCellMapping(string key, [MaybeNullWhen(false)] out CellMappingDeclaration d)
        {
            if (cellMappingsByKeyDirty)
            {
                cellMappingsByKey.Clear();
                foreach (var m in CellMappings.ToArray())
                {
                    if (m.Key != null)
                    {
                        cellMappingsByKey[m.Key] = m;
                    }
                }
            }

            return(cellMappingsByKey.TryGetValue(key, out d));
        }