private void LoadFile(string fileName) { if (string.IsNullOrEmpty(fileName)) { return; } _configDataDic.Clear(); BehaviorReadWrite readWrite = new BehaviorReadWrite(); BehaviorTreeData behaviorTreeData = ReadFile(fileName, true); if (null == behaviorTreeData) { //ProDebug.Logger.LogError("file is null:" + fileName); return; } _playState = BehaviorPlayType.STOP; NodeNotify.SetPlayState((int)_playState); _fileName = fileName; _behaviorTreeData = behaviorTreeData; _currentSelectId = -1; _currentOpenSubTreeId = -1; BehaviorRunTime.Instance.Reset(behaviorTreeData); }
private void LoadFile(string fileName) { string path = GetFilePath(fileName); if (!File.Exists(path)) { if (!EditorUtility.DisplayDialog("提示", "文件不存在", "yes")) { } return; } _playState = BehaviorPlayType.STOP; NodeNotify.SetPlayState((int)_playState); BehaviorReadWrite readWrite = new BehaviorReadWrite(); BehaviorTreeData behaviorTreeData = readWrite.ReadJson(path); if (null == behaviorTreeData) { Debug.LogError("file is null:" + fileName); return; } _fileName = fileName; _behaviorTreeData = behaviorTreeData; BehaviorRunTime.Instance.Reset(behaviorTreeData); }
private void LoadFile(string fileName) { string path = GetFilePath(fileName); if (!File.Exists(path)) { if (!EditorUtility.DisplayDialog("提示", "文件不存在", "yes")) { } return; } _playState = HSMPlayType.STOP; NodeNotify.SetPlayState((int)_playState); HSMReadWrite readWrite = new HSMReadWrite(); SkillHsmConfigHSMTreeData HSMTreeData = readWrite.ReadJson(path); if (null == HSMTreeData) { Debug.LogError("file is null:" + fileName); return; } _fileName = fileName; _HSMTreeData = HSMTreeData; _currentOpenSubMachineId = -1; HSMRunTime.Instance.Reset(HSMTreeData); }
private void RuntimePlay(BehaviorPlayType state) { NodeNotify.SetPlayState((int)state); _playState = state; }
private void RuntimePlay(BehaviorPlayType state) { BehaviorRunTime.Instance.RuntimePlay(_playState, state); NodeNotify.SetPlayState((int)state); _playState = state; }