Exemplo n.º 1
0
 private void OnEnable()
 {
     if (Application.isPlaying && Parent != null &&
         !Parent.IsInstance && !Parent.IsStatic)
     {
         Parent = Parent.Clone();
     }
     _blackboard.InitializePropertiesBinding(null, false);
 }
        ///Loads back the Blackboard from PlayerPrefs of the provided saveKey. You can use this for a Save system
        public bool Load(string saveKey)
        {
            var dataString = PlayerPrefs.GetString(saveKey);

            if (string.IsNullOrEmpty(dataString))
            {
                Debug.Log("No data to load");
                return(false);
            }

            _blackboard = JSON.Deserialize <BlackboardSource>(dataString, _objectReferences);
            _blackboard.InitializePropertiesBinding(propertiesBindTarget, true);
            return(true);
        }
Exemplo n.º 3
0
 void Awake()
 {
     //Call to bind the variables with respected properties on the target game object
     _blackboard.InitializePropertiesBinding(propertiesBindTarget, false);
 }