Esempio n. 1
0
    // TODO glitch where progress ends at -1
    public override void Interact(DwarfControl entity)
    {
        base.Interact(entity);

        progress--;             // chip at progress

        if (progress <= 0)
        {
            //we done
            harvested = true;
            //idle entity
            entity.setTask("Idle", null);
        }
        else
        {
            // wait a bit before reseting hasInteracted
            StartCoroutine(pause(1.0f, entity));
        }

        if (progress == -1)
        {
            //make the building
            construct();
        }
    }
Esempio n. 2
0
    public override void Interact(DwarfControl entity)
    {
        Resource x = entity.carriedResource;

        resources.Add(entity.carriedResource);

        entity.carriedResource = null;

        print("Resource: " + x.resourceName + " added to stockpile");

        //idle entity
        entity.setTask("Idle", null);
    }
Esempio n. 3
0
    public override void Interact(DwarfControl entity)
    {
        base.Interact(entity);

        //give entity wood
        entity.CarryResource(resource);

        //send to stockpile
        entity.setTask("Deposit", null);

        quantity--;

        if (quantity <= 0)
        {
            harvested = true;
        }
    }
Esempio n. 4
0
 public virtual void Interact(DwarfControl entity)
 {
     //meant to be overwritten
     print("Interacting!");
 }
Esempio n. 5
0
    private IEnumerator pause(float waitTime, DwarfControl entity)
    {
        yield return(new WaitForSeconds(waitTime));

        entity.hasInteracted = false;
    }