示例#1
0
        void Awake()
        {
            string btExportPath = WorkspaceExportPath;

            behaviac.Workspace.EFileFormat btFileFormat = behaviac.Workspace.EFileFormat.EFF_cs;

            //set workspace exportpath
            behaviac.Workspace.SetWorkspaceSettings(btExportPath, btFileFormat);

            //export meta file
            //string metaExportFile = Application.dataPath + "/BTWorkspace/xmlmeta/WPowerMeta.xml";
            //behaviac.Workspace.ExportMetas(metaExportFile);

            //for dedug
            bool ret = behaviac.SocketUtils.SetupConnection(false);

            if (!ret)
            {
                //Debug.LogWarning("can't connection!");
            }

            behaviac.Agent.SetIdMask(0xffffffff);

            behaviac.Config.IsLogging   = true;
            behaviac.Config.IsSocketing = true;
        }
示例#2
0
    public bool Init()
    {
        if (ms_fileSystem == null)
        {
            ms_fileSystem = new BehaviacFileManager();
        }

        bool bInit = false;

        if (this.FileFormat != ms_fileFormat)
        {
            ms_fileFormat = this.FileFormat;
            bInit         = true;
        }

        //only init it when the file format changed at the init is slow
        if (bInit)
        {
            if (ms_bInit)
            {
                behaviac.Workspace.Instance.Cleanup();

                behaviac.LogManager.Close();
            }

            ms_bInit = true;

            //< write log file
            behaviac.Config.IsLogging   = true;
            behaviac.Config.IsSocketing = false;

            behaviac.Workspace.Instance.FilePath   = this.FilePath;
            behaviac.Workspace.Instance.FileFormat = this.FileFormat;

            //register names
            behaviac.Agent.RegisterInstanceName <ParTestRegNameAgent>();

            behaviac.Workspace.Instance.ExportMetas("behaviac/workspace/xmlmeta/unittestmeta.xml");

            behaviac.Debug.Log("Behaviac meta data export over.");

            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
示例#3
0
    public bool init()
    {
        if (!m_bIsInited)
        {
            m_bIsInited = true;

            if (fileSystem == null)
            {
                fileSystem = new BehaviacFileManager();
            }

            int formatID = getTestFormat();
            behaviac.Workspace.EFileFormat btFormat = (behaviac.Workspace.EFileFormat)formatID;

            string btExportPath = exportPath;
            behaviac.Workspace.EFileFormat btFileFormat = btFormat;
            behaviac.Workspace.SetWorkspaceSettings(btExportPath, btFileFormat);
            //register names
            behaviac.Agent.RegisterName <ParTestRegNameAgent>();

            string metaExportPath = workspacePath + "/xmlmeta/UnitTestMeta.xml";
            behaviac.Workspace.ExportMetas(metaExportPath);

            //TODO
            behaviac.IVariable.Register <TNS.ST.PER.WRK.kEmployee>("TNS.ST.PER.WRK.kEmployee");
            behaviac.IVariable.Register <TNS.NE.NAT.eColor>("TNS.NE.NAT.eColor");
            behaviac.IVariable.Register <ParTestAgentBase>("ParTestAgentBase");
            behaviac.IVariable.Register <TNS.ST.PER.WRK.kEmployee>("kEmployee");
            behaviac.IVariable.Register <TNS.NE.NAT.eColor>("eColor");

            behaviac.Debug.Log("Behaviac meta data export over.");

            behaviac.Workspace.RespondToBreakHandler += RespondToBreak;

            //< write log file
            //behaviac.Config.IsLogging = false;
            //behaviac.Config.IsSocketing = false;

            bool isBlockSocket = false;
            behaviac.SocketUtils.SetupConnection(isBlockSocket);
            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
示例#4
0
    public bool init()
    {
        if (!m_bIsInited)
        {
            m_bIsInited = true;

            if (fileSystem == null)
            {
                fileSystem = new BehaviacFileManager();
            }
            //behaviac.Workspace.RegisterBehaviorNode ();

            //register agents
            //behaviac.Workspace.RegisterMetas ();
            string btExportPath = GameLevelCommon.WorkspaceExportedPath;
            behaviac.Workspace.EFileFormat btFileFormat = behaviac.Workspace.EFileFormat.EFF_xml;
            behaviac.Workspace.SetWorkspaceSettings(btExportPath, btFileFormat);
            //register names
            behaviac.Agent.RegisterName <GameLevelCommon> ("GameLevel");

            string metaExportPath = GameLevelCommon.WorkspacePath + "/xmlmeta/BattleCityMeta.xml";
            behaviac.Workspace.ExportMetas(metaExportPath);
            behaviac.Debug.Log("Behaviac meta data export over.");

            //behaviac.Workspace.RespondToBreakHandler += RespondToBreak;

            //< write log file
            //behaviac.Config.IsLogging = false;
            //behaviac.Config.IsSocketing = false;

            bool isBlockSocket = false;
            behaviac.SocketUtils.SetupConnection(isBlockSocket);
            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
示例#5
0
    public bool Init()
    {
        if (ms_fileSystem == null)
        {
            ms_fileSystem = new BehaviacFileManager();
        }

        bool bInit = false;

        if (this.FileFormat != ms_fileFormat)
        {
            ms_fileFormat = this.FileFormat;
            bInit = true;
        }

        //only init it when the file format changed at the init is slow
        if (bInit)
        {
            if (ms_bInit)
            {
                behaviac.Workspace.Instance.Cleanup();

                behaviac.LogManager.Instance.Close();
            }

            ms_bInit = true;

            //< write log file
            behaviac.Config.IsLogging = true;
            behaviac.Config.IsSocketing = false;

            behaviac.Workspace.Instance.FilePath = this.FilePath;
            behaviac.Workspace.Instance.FileFormat = this.FileFormat;

            //register names
            behaviac.Agent.RegisterInstanceName<ParTestRegNameAgent>();

            behaviac.Workspace.Instance.ExportMetas("behaviac/workspace/xmlmeta/unittestmeta.xml");

            behaviac.Debug.Log("Behaviac meta data export over.");

            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return true;
    }