Example #1
0
        public override void Activate(BTDatabase database)
        {
            base.Activate(database);

            _precondition1.Activate(database);
            _precondition2.Activate(database);
        }
Example #2
0
 protected virtual void Init()
 {
     database = GetComponent <BTDatabase>();
     if (database == null)
     {
         database = gameObject.AddComponent <BTDatabase>();
     }
 }
Example #3
0
        public void Deactive()
        {
            if (!activated)
            {
                return;
            }
            this.database = null;
            //			Init();

            if (precondition != null)
            {
                precondition.Deactive();
            }
            if (_children != null)
            {
                for (int i = 0; i < _children.Count; ++i)
                {
                    _children[i].Deactive();
                }
            }

            activated = false;
        }
Example #4
0
        public virtual void Activate(BTDatabase database)
        {
            if (activated)
            {
                return;
            }

            this.database = database;
            //			Init();

            if (precondition != null)
            {
                precondition.Activate(database);
            }
            if (_children != null)
            {
                for (int i = 0; i < _children.Count; ++i)
                {
                    _children[i].Activate(database);
                }
            }

            activated = true;
        }
Example #5
0
 public override void Activate(BTDatabase database)
 {
     base.Activate(database);
     _dataIdToCheck = database.GetDataId(_dataToCheck);
     database.SetData <T>(_dataIdToCheck, _defaultValue);
 }
Example #6
0
        public override void Activate(BTDatabase database)
        {
            base.Activate(database);

            _dataIdToCheck = database.GetDataId(_dataToCheck);
        }