//todo public bool Trigger(Vector3 point, Vector3 direction, DeepEntity target) { foreach (D_Resource key in resourcesToTrigger.Keys) { if (!parent.resources.ContainsKey(key)) { Debug.LogError(parent.gameObject.name + "Does not have the resource: " + key); } else { if (parent.resources[key].GetValue() < resourcesToTrigger[key]) { return(false); } } } foreach (D_Resource key in resourcesToTrigger.Keys) { parent.resources[key].TryToConsume(resourcesToTrigger[key]); } parent.events.Trigger?.Invoke(point, direction, target); return(true); }
IEnumerator DestroyCo(DeepEntity deepEntity) { yield return(new WaitForSeconds(5f)); parent.RemoveBehavior(this); }