Exemplo n.º 1
0
    public void Init()
    {
        _filePath         = "Assets/SubAssets/GameData/BehaviorTree/";
        _fileName         = string.Empty;
        _behaviorTreeData = new BehaviorTreeData();
        _runTimeInvalidSubTreeHash.Clear();

        behaviorChangeRootNode         += ChangeRootNode;
        behaviorChangeSelectId         += ChangeSelectId;
        behaviorAddNode                += AddNode;
        behaviorDeleteNode             += DeleteNode;
        behaviorLoadFile               += LoadFile;
        behaviorSaveFile               += SaveFile;
        behaviorDeleteFile             += DeleteFile;
        behaviorNodeAddChild           += NodeAddChild;
        behaviorRemoveParentNode       += RemoveParentNode;
        behaviorNodeParameter          += NodeParameterChange;
        parameterChange                += ParameterChange;
        behaviorNodeChangeParameter    += NodeChangeParameter;
        behaviorRuntimePlay            += RuntimePlay;
        behaviorAddDelConditionGroup   += NodeAddDelConditionGroup;
        behaviorOpenSubTree            += OpenSubTree;
        behaviorChangeSubTreeEntryNode += ChangeSubTreeEntryNode;
        behaviorDeleteSubTreeChild     += DeleteSubTreeChild;
        behaviorReadFile               += ReadFile;
        behaviorStandardID             += StandardID;
        behaviorSelectFile             += SelectFile;
        behaviorSaveSubTree            += SaveSubTree;
        behaviorDebugNodeParentInfo    += DebugNodeParentInfo;

        _currentSelectId      = -1;
        _currentOpenSubTreeId = -1;

        _playState = BehaviorPlayType.STOP;
    }
Exemplo n.º 2
0
    public void OnDestroy()
    {
        behaviorChangeRootNode         -= ChangeRootNode;
        behaviorChangeSelectId         -= ChangeSelectId;
        behaviorAddNode                -= AddNode;
        behaviorDeleteNode             -= DeleteNode;
        behaviorLoadFile               -= LoadFile;
        behaviorSaveFile               -= SaveFile;
        behaviorDeleteFile             -= DeleteFile;
        behaviorNodeAddChild           -= NodeAddChild;
        behaviorRemoveParentNode       -= RemoveParentNode;
        behaviorNodeParameter          -= NodeParameterChange;
        parameterChange                -= ParameterChange;
        behaviorNodeChangeParameter    -= NodeChangeParameter;
        behaviorRuntimePlay            -= RuntimePlay;
        behaviorAddDelConditionGroup   -= NodeAddDelConditionGroup;
        behaviorOpenSubTree            -= OpenSubTree;
        behaviorChangeSubTreeEntryNode -= ChangeSubTreeEntryNode;
        behaviorDeleteSubTreeChild     -= DeleteSubTreeChild;
        behaviorReadFile               -= ReadFile;
        behaviorStandardID             -= StandardID;
        behaviorSelectFile             -= SelectFile;
        behaviorSaveSubTree            -= SaveSubTree;
        behaviorDebugNodeParentInfo    -= DebugNodeParentInfo;

        _playState = BehaviorPlayType.STOP;

        AssetDatabase.Refresh();
        UnityEngine.Caching.ClearCache();
    }
Exemplo n.º 3
0
    public void Init()
    {
        _filePath         = "Assets/Resources/Data/";
        _fileName         = string.Empty;
        _behaviorTreeData = new BehaviorTreeData();

        BehaviorReadWrite readWrite = new BehaviorReadWrite();

        _globalParameter = readWrite.ReadGlobalParameter(GetGlobalParameterPath());

        behaviorChangeSelectId      += ChangeSelectId;
        behaviorAddNode             += AddNode;
        behaviorDeleteNode          += DeleteNode;
        behaviorLoadFile            += LoadFile;
        behaviorSaveFile            += SaveFile;
        behaviorDeleteFile          += DeleteFile;
        behaviorNodeAddChild        += NodeAddChild;
        behaviorRemoveParentNode    += RemoveParentNode;
        behaviorNodeParameter       += NodeParameterChange;
        globalParameterChange       += GlobalParameterChange;
        behaviorNodeChangeParameter += NodeChangeParameter;
        behaviorRuntimePlay         += RuntimePlay;

        _playState = BehaviorPlayType.STOP;
    }
Exemplo n.º 4
0
    public void OnDestroy()
    {
        behaviorChangeSelectId      -= ChangeSelectId;
        behaviorAddNode             -= AddNode;
        behaviorDeleteNode          -= DeleteNode;
        behaviorLoadFile            -= LoadFile;
        behaviorSaveFile            -= SaveFile;
        behaviorDeleteFile          -= DeleteFile;
        behaviorNodeAddChild        -= NodeAddChild;
        behaviorRemoveParentNode    -= RemoveParentNode;
        behaviorNodeParameter       -= NodeParameterChange;
        globalParameterChange       -= GlobalParameterChange;
        behaviorNodeChangeParameter -= NodeChangeParameter;
        behaviorRuntimePlay         -= RuntimePlay;

        _playState = BehaviorPlayType.STOP;
    }
Exemplo n.º 5
0
    public void OnDestroy()
    {
        behaviorChangeSelectId       -= ChangeSelectId;
        behaviorAddNode              -= AddNode;
        behaviorDeleteNode           -= DeleteNode;
        behaviorLoadFile             -= LoadFile;
        behaviorSaveFile             -= SaveFile;
        behaviorDeleteFile           -= DeleteFile;
        behaviorNodeAddChild         -= NodeAddChild;
        behaviorRemoveParentNode     -= RemoveParentNode;
        behaviorNodeParameter        -= NodeParameterChange;
        parameterChange              -= ParameterChange;
        behaviorNodeChangeParameter  -= NodeChangeParameter;
        behaviorRuntimePlay          -= RuntimePlay;
        behaviorAddDelConditionGroup -= NodeAddDelConditionGroup;

        _playState = BehaviorPlayType.STOP;

        AssetDatabase.Refresh();
        UnityEngine.Caching.ClearCache();
    }
Exemplo n.º 6
0
    public void Init()
    {
        _filePath         = "Assets/SubAssets/GameData/BehaviorTree/";
        _fileName         = string.Empty;
        _behaviorTreeData = new BehaviorTreeData();

        behaviorChangeSelectId       += ChangeSelectId;
        behaviorAddNode              += AddNode;
        behaviorDeleteNode           += DeleteNode;
        behaviorLoadFile             += LoadFile;
        behaviorSaveFile             += SaveFile;
        behaviorDeleteFile           += DeleteFile;
        behaviorNodeAddChild         += NodeAddChild;
        behaviorRemoveParentNode     += RemoveParentNode;
        behaviorNodeParameter        += NodeParameterChange;
        parameterChange              += ParameterChange;
        behaviorNodeChangeParameter  += NodeChangeParameter;
        behaviorRuntimePlay          += RuntimePlay;
        behaviorAddDelConditionGroup += NodeAddDelConditionGroup;

        _playState = BehaviorPlayType.STOP;
    }