luxkun / ReGoap

Generic C# GOAP (Goal Oriented Action Planning) library with Unity3d examples
Apache License 2.0
1.02k stars 149 forks source link

example bug #9

Closed laurentopia closed 7 years ago

laurentopia commented 7 years ago

primitiveresource.cs doesn't shrink the resource as intended so it should be:

`using UnityEngine; using System.Collections;

public class PrimitiveResource : Resource { public float MinScalePercentage = 0.1f; private Vector3 startingScale;

protected override void Awake () { base.Awake (); startingScale = transform.localScale; }

public override void RemoveResource(float value) { base.RemoveResource(value); transform.localScale = startingScale (MinScalePercentage + (1f - MinScalePercentage) (Capacity/startingCapacity)); // scale down based on capacity } }`

luxkun commented 7 years ago

You could have made a pull request!

Anyway appreciated the code and added it to the current master.