コード例 #1
0
            private void MarkIndicatorTiles()
            {
                indicators.ClearAllTiles();

                for (int i = 0; i < Enum.GetNames(typeof(TileIndicatorTypes)).Length; i++)
                {
                    TileIndicatorTypes indicatorType = (TileIndicatorTypes)i;

                    if (indicatorTiles.ContainsKey(indicatorType))
                    {
                        List <Vector3Int> tilesToMark = indicatorTiles[indicatorType];

                        TileBase tileBase = GetTileFromIndicator(indicatorType);

                        foreach (Vector3Int tile in tilesToMark)
                        {
                            Vector3Int placement = new Vector3Int(tile.x + 1, tile.y + 1, tile.z - 1);

                            if (geography.HasTile(placement))
                            {
                                indicators.SetTile(placement, tileBase);
                            }
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
            }
コード例 #2
0
            private TileBase GetTileFromIndicator(TileIndicatorTypes indicatorType)
            {
                switch (indicatorType)
                {
                case TileIndicatorTypes.Movement:
                    return(ScriptableObject.CreateInstance <MovementIndicator>());

                case TileIndicatorTypes.LoadingZone:
                    return(ScriptableObject.CreateInstance <LoadingZoneIndicator>());

                case TileIndicatorTypes.Aggro:
                    return(ScriptableObject.CreateInstance <AggroIndicator>());

                case TileIndicatorTypes.Encounter:
                    return(ScriptableObject.CreateInstance <EncounterIndicator>());

                case TileIndicatorTypes.AllyTargetingSkill:
                    return(ScriptableObject.CreateInstance <AllyTargetingSkillIndicator>());

                case TileIndicatorTypes.EnemyTargetingSkill:
                    return(ScriptableObject.CreateInstance <EnemyTargetingSkillIndicator>());

                default:
                    return(ScriptableObject.CreateInstance <MovementIndicator>());
                }
            }
コード例 #3
0
            public void RemoveIndicatorTiles(TileIndicatorTypes indicatorType)
            {
                if (indicatorTiles.ContainsKey(indicatorType))
                {
                    indicatorTiles.Remove(indicatorType);
                }

                MarkIndicatorTiles();
            }
コード例 #4
0
            /// <summary>
            /// Marks instance tiles with a specified tile indicator type.
            /// </summary>
            /// <param name="tilesToMark">The tiles to be marked with indicators.</param>
            /// <param name="indicatorType">The type of indicator to mark the tiles with.</param>
            public void AddIndicatorTiles(List <Vector3Int> tilesToMark, TileIndicatorTypes indicatorType)
            {
                if (indicatorTiles.ContainsKey(indicatorType))
                {
                    indicatorTiles[indicatorType] = tilesToMark;
                }
                else
                {
                    indicatorTiles.Add(indicatorType, tilesToMark);
                }

                MarkIndicatorTiles();
            }