Exemplo n.º 1
0
    void Update()
    {
        // ePlayerState의 Stop을 사용하면 안됨, Farm Scene에서 의도하지 않은 일이 벌어질 수 있음

        if (MoveState == ePlayerState.Move)
        {
            if (OwnCharacter != null)
            {
                if ((Vector2)transform.position == targetPos)
                {
                    OwnCharacter.EndRun();
                    MoveState = ePlayerState.Stop;
                    _outlineshader.StopWalkEffect();
                    return;
                }
                MoveToTargetPos();
                _outlineshader.PlayWalkEffect();
            }
        }
    }
Exemplo n.º 2
0
    void EnterTile()
    {
        OwnCharacter.EndRun();

        if (FriendFarmManager.Instance != null)
        {
            return;
        }

        Point currentPoint = _currentLandTile.MapPoint;

        MapData.Instance.CurrentFarmerPoint = currentPoint;
        _currentLandTile.Highlight          = true;

        _currentProductTile = ObjectTileManager.Instance.GetProductTileAtPoint(currentPoint);

        float grownSpeed = 0.0f;

        switch (_currentLandTile.Type)
        {
        case LandTile.BadlandType:
            grownSpeed = LandTile.BadlandGrownSpeedScale;
            break;

        case LandTile.GrassType:
            grownSpeed = LandTile.GrassGrownSpeedScale;
            break;

        case LandTile.CultivateType:
            grownSpeed = LandTile.CultivateGrownSpeedScale;
            break;

        default:
            Debug.LogWarning("Unknown Land Type!");
            break;
        }
        FarmUIManager.Instance.UpdateLandTileChangeInteract(_currentLandTile.Type);

        if (ObjectTileManager.Instance.HasObjectTileAtPoint(currentPoint))
        {
            if (ObjectTileManager.Instance.GetObjectTileTypeAtPoint(currentPoint) == ObjectTile.ETileType.Garbage)
            {
                _currentGarbageTile = ObjectTileManager.Instance.GetGarbageTileAtPoint(currentPoint);
                FarmUIManager.Instance.GarbageTileFuncButtonInteract(_currentGarbageTile.GetGarbageData());
            }
            else
            {
                FarmUIManager.Instance.ObjectTileFuncButtonInteract(false);
            }
        }
        else
        {
            FarmUIManager.Instance.UpdatePlantProductEffectText(grownSpeed);
            FarmUIManager.Instance.ObjectTileFuncButtonInteract(true);
        }

        if (_currentProductTile != null)
        {
            // 수확 기능
            if (_currentProductTile.CanHarvest)
            {
                FarmUIManager.Instance.HarvestButtonActive = true;
            }
            else
            {
                StartCoroutine(CheckCanHarvestEverySeconds());
            }

            // 상단
            FarmUIManager.Instance.ProductInfoGroupActive = true;
            FarmUIManager.Instance.SetProductInfoData(_currentProductTile.ProductData, grownSpeed);
        }
    }