Esempio n. 1
0
    protected virtual void ChangeState(eBuildingState state)
    {
        if (buildingState != state)
        {
            switch (buildingState)
            {
            case eBuildingState.Construction:
                break;

            case eBuildingState.Standby:
                StopCoroutine("Standby");
                break;

            case eBuildingState.Work:
                StopCoroutine("Work");
                break;

            case eBuildingState.Sleep:
                break;
            }
            buildingState = state;
            switch (state)
            {
            case eBuildingState.Construction:
                break;

            case eBuildingState.Standby:
                StartCoroutine("Standby");
                break;

            case eBuildingState.Work:
                StartCoroutine("Work");
                break;

            case eBuildingState.Sleep:
                break;
            }
        }
    }
Esempio n. 2
0
    protected IEnumerator Construction()
    {
        yield return(null);

        buildingState = eBuildingState.Construction;
        Target.MyBar.SetProgress(dicCost["time"]);
        model.enabled = false;
        while (true)
        {
            Target.MyBar.CurProgress((int)fComplete);
            if (fComplete >= dicCost["time"])
            {
                ChangeState(eBuildingState.Standby);
                model.enabled      = true;
                constModel.enabled = false;
                Target.MyBar.InProgress();
                yield break;
            }
            yield return(null);
        }

        yield break;
    }
Esempio n. 3
0
    protected override void ChangeState(eBuildingState state)
    {
        if (buildingState != state)
        {
            switch (buildingState)
            {
            case eBuildingState.Construction:
                owner.AddStorage("Food", 100);
                break;

            case eBuildingState.Standby:
                break;

            case eBuildingState.Work:
                break;

            case eBuildingState.Sleep:
                break;
            }
            buildingState = state;
            switch (state)
            {
            case eBuildingState.Construction:
                break;

            case eBuildingState.Standby:
                break;

            case eBuildingState.Work:

                break;

            case eBuildingState.Sleep:
                break;
            }
        }
    }