Beispiel #1
0
        public void Run()
        {
            //todo move into IEnumerator
            CubeCoords playerCoords = HexMath.Pix2Hex(_player.Transform.localPosition.x, _player.Transform.localPosition.y, HexSize);

            if (_map.LastCoords.x != playerCoords.x || _map.LastCoords.y != playerCoords.y)
            {
                UnrenderRing(_map.LastCoords, Fow + 1);
                RenderRing(playerCoords, Fow);
                _map.LastCoords = playerCoords;
            }

            for (int i = 0; i < _collisionEvents.EntitiesCount; i++)
            {
                CubeCoords coords = HexMath.Pix2Hex(_collisionEvents.Components1[i].ObstacleTransform.position, HexSize);
            }
            for (int i = 0; i < _triggerForegroundEvents.EntitiesCount; i++)
            {
                CubeCoords             coords       = HexMath.Pix2Hex(_triggerForegroundEvents.Components1[i].ObstacleTransform.position, HexSize);
                HexForegroundComponent hexComponent = _map.MapF[coords.x, coords.y];
                switch (hexComponent.ForegroundType)
                {
                case ForegroundTypes.Diamond:
                    _player.Exp += hexComponent.Value;
                    RemoveFore(hexComponent, coords);
                    break;

                default:
                    break;
                }
            }
        }