Example #1
0
    /// <summary>
    /// 处理NPC刷新时间
    /// </summary>
    /// <param name="hour"></param>
    /// <returns></returns>
    private void HandleNpcBuildTime(int hour)
    {
        if (hour > 6 && hour <= 9)
        {
            buildInterval = 3.5f;
        }
        else if (hour > 9 && hour <= 12)
        {
            buildInterval = 2.5f;
        }
        else if (hour > 12 && hour <= 18)
        {
            buildInterval = 1.5f;
        }
        else if (hour > 18 && hour <= 21)
        {
            buildInterval = 2.5f;
        }
        else if (hour > 21 && hour <= 24)
        {
            buildInterval = 3.5f;
        }
        else
        {
            buildInterval = 5;
        }
        //天气加成
        buildInterval -= GameWeatherHandler.Instance.manager.weatherData.weatherAddition;

        GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData();

        gameData.GetInnAttributesData().GetInnLevel(out int levelTitle, out int levelStar);
        if (levelTitle == 1)
        {
            buildInterval = buildInterval * 0.9f;
        }
        else if (levelTitle == 2)
        {
            buildInterval = buildInterval * 0.65f;
        }
        else if (levelTitle == 3)
        {
            buildInterval = buildInterval * 0.4f;
        }
        InnAttributesBean innAttributes = gameData.GetInnAttributesData();
        InnBuildBean      innBuild      = gameData.GetInnBuildData();

        buildCustomerForHotelRate = innAttributes.CalculationCustomerForHotelRate(innBuild);
        buildTeamGustomerRate     = innAttributes.CalculationTeamCustomerBuildRate();
        float buildGustomerRate = innAttributes.CalculationCustomerBuildRate();

        buildInterval = buildInterval / buildGustomerRate;
    }
Example #2
0
    private void Start()
    {
        GameDataBean      gameData      = GameDataHandler.Instance.manager.GetGameData();
        InnAttributesBean innAttributes = gameData.GetInnAttributesData();
        InnBuildBean      innBuild      = gameData.GetInnBuildData();

        buildCustomerForHotelRate = innAttributes.CalculationCustomerForHotelRate(innBuild);
        buildTeamGustomerRate     = innAttributes.CalculationTeamCustomerBuildRate();
        buildMaxNumber            = 500;
        GameTimeHandler.Instance.RegisterNotifyForTime(NotifyForTime);
        StartBuildCustomer();
    }