コード例 #1
0
        //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);
        }
コード例 #2
0
ファイル: ExampleBehavior.cs プロジェクト: Sherbb/DeepAction
        IEnumerator DestroyCo(DeepEntity deepEntity)
        {
            yield return(new WaitForSeconds(5f));

            parent.RemoveBehavior(this);
        }