示例#1
0
    void Awake()
    {
        _boxCollider2D = GetComponent<BoxCollider2D>();
        _SpriteRender = GetComponent<SpriteRenderer>();

        Statistic = new StationStatistic(HitPoints, Speed, Level, ActualCraftingPoints);
    }
示例#2
0
    public void ToggleOn(WorkStation Station , Item item)
    {
        gameObject.SetActive(true);

        Statistic = Station.getStatistic();
        Speed.text = Statistic.Speed.ToString();
        HitPower.text = Statistic.HitPoints.ToString();
        ProgressGoal.text = item.Information.RequireHitPoints.ToString();
        this.item = item;

        Image.texture = item.image.sprite.texture;
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        Statistic = new StationStatistic(HitPoints, Speed, Level, 0);

        Time = DateTime.Now;

        // TimeSpan timespan = DateTime.Now - DateTime.Parse(PlayerData.Time);
        if (mode == Mode.TO_SELL) return;
        DateTime time = new DateTime();
        time = DateTime.Parse(PlayerData.Time);

        TimeSpan timespan = DateTime.Now - time;

        int Frequency = (int)(timespan.TotalSeconds / Statistic.Speed);

        int Hits = (int)(timespan.TotalSeconds / Statistic.Speed);

        int craftResult = (int)(Hits * HitPoints) / CraftingItem.Information.RequireHitPoints;
        if (craftResult > 0)
        {

            CraftingItem.Information.Number = CraftingItem.Information.Number + craftResult;
            stuffMenu.AddElement(CraftingItem);

            ActualCraftingPoints = ActualCraftingPoints + (Hits * HitPoints % CraftingItem.Information.RequireHitPoints);

            CraftingItem.Information.Number = 1;
        }
        else
        {
            ActualCraftingPoints = ActualCraftingPoints + (Hits * HitPoints % CraftingItem.Information.RequireHitPoints);

        }

        // Debug.Log("Time span " + timespan.TotalSeconds);
        // Debug.Log("Frequency:" + Frequency);

        //PlayerData.Gold = PlayerData.Gold + (25 * Frequency);
    }