コード例 #1
0
    static void LoadItems()
    {
        NetworkBehavior.LoadNetworks(user_app_path);
        procedural_settings = new ProceduralScript("procedural.txt");
        physical_settings   = new ProceduralScript("physical.txt");
        Debug.Log("Calling LoadHardwareTypes");
        CatalogBehavior.LoadHardwareTypes();
        CatalogBehavior.LoadCatalog(user_app_path);
        OrganizationScript.LoadOrganization();
        GameObject      ws        = GameObject.Find("WorkSpace");
        WorkSpaceScript ws_script = (WorkSpaceScript)ws.GetComponent(typeof(WorkSpaceScript));

        WorkSpaceScript.LoadWorkSpace();
        dac_groups = new DACGroups();
        UserBehavior.LoadUsers();
        AssetBehavior.LoadAssets();
        ComputerBehavior.LoadAllComputers();
        DeviceBehavior.LoadDevices(user_app_path);
        ITStaffBehavior.LoadStaffFromFile();
        ZoneBehavior.LoadZones();
        ObjectivesBehavior.LoadObjectives();

        //UserBehavior.UpdateStatus();
        //LoadMainOffice();
    }
コード例 #2
0
 public DACAccess(string user_mode_list, AssetBehavior asset)
 {
     //Debug.Log("DACAccess for " + user_mode_list);
     SetAccess(user_mode_list);
     this.asset               = asset;
     option_map["Yes"]        = 'Y';
     option_map["No"]         = 'N';
     option_map["-"]          = '-';
     option_map["Don't care"] = 'X';
 }
コード例 #3
0
    public void LoadComputerInfoFromFile()
    {
        this.config_settings = new ConfigurationSettings(true, this.component_name);

        try
        {
            StreamReader reader = new StreamReader(filePath, Encoding.Default);
            using (reader)
            {
                string tag;
                //Debug.("LoadComputer read from " + filePath);
                ccUtils.PositionAfter(reader, "Component");
                string value = null;
                do
                {
                    value = ccUtils.SDTNext(reader, out tag).Trim();
                    if (value == null)
                    {
                        continue;
                    }
                    //Debug.Log("LoadComputer got " + value + " for tag " + tag);
                    if (!this.config_settings.HandleConfigurationSetting(tag, value))
                    {
                        switch (tag)
                        {
                        case "Assets":
                            asset_list.Add(value);
                            AssetBehavior asset = AssetBehavior.asset_dict[value];
                            asset.SetComputer(this);
                            break;

                        case "AccessListLocal":
                            user_list.Add(value);
                            break;

                        case "User":
                            assigned_user = value;
                            break;

                        case "HW":
                            hw_name = value;
                            break;
                        }
                    }
                }while (value != null);
            }
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message + "\n");
        }
    }
コード例 #4
0
    public static void LoadOneAsset(string asset_file)
    {
        GameObject asset = GameObject.Find("Asset");
        //Debug.Log("user_app_path" + user_app_path + " file [" + User_file+"]");
        string cfile = System.IO.Path.Combine(GameLoadBehavior.user_app_path, asset_file);

        GameObject    new_c  = Instantiate(asset, new Vector3(1.0F, 0, 0), Quaternion.identity);
        AssetBehavior script = (AssetBehavior)new_c.GetComponent(typeof(AssetBehavior));

        script.SetFilePath(cfile);
        new_c.SetActive(true);
        script.LoadAsset();
    }
コード例 #5
0
    public void ACLClicked()
    {
        string asset_name = this.asset_dropdown.captionText.text;

        Debug.Log("ACL clicked, current asset is <" + asset_name + ">");
        AssetBehavior asset_script = AssetBehavior.asset_dict[asset_name];
        string        dac_string   = asset_script.GetDACString();

        Debug.Log(dac_string);
        GameObject acl_panel = menus.menu_panels["ACLPanel"];

        acl_panel.SetActive(true);
        ACLConfigure acl_script = (ACLConfigure)acl_panel.GetComponent(typeof(ACLConfigure));

        acl_script.SetDAC(asset_script.GetDACAccess());
        //menus.clicked = "Component:" + current_computer.component_name + ":Configure:ACL:" + asset_name;
    }