Exemplo n.º 1
0
		protected virtual void OnPluginLoaded (Ethos.PluginInfo plugin_info)
		{
			GLib.Value ret = GLib.Value.Empty;
			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
			GLib.Value[] vals = new GLib.Value [2];
			vals [0] = new GLib.Value (this);
			inst_and_params.Append (vals [0]);
			vals [1] = new GLib.Value (plugin_info);
			inst_and_params.Append (vals [1]);
			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
			foreach (GLib.Value v in vals)
				v.Dispose ();
		}
Exemplo n.º 2
0
    //function used to randomly select ethos, civics and negative traits
    private void RaceGeneration(List <string> newNames)
    {
        if (!resultsWindow.activeInHierarchy)
        {
            resultsWindow.SetActive(true);
        }

        foreach (var name in newNames)
        {
            tempResultsObj = Instantiate(resultsObject);
            tempResultsObj.transform.SetParent(resultsTransform, false);

            tempNameObj = Instantiate(playerNameObject);
            tempNameObj.GetComponentInChildren <Text>().text = name.ToString();
            tempNameObj.transform.SetParent(tempResultsObj.transform, false);

            tempEthos = RandomGeneration(ethosList);

            civicID = RandomGeneration(tempEthos.civicIDs);
            Debug.Log("Civic ID: " + civicID);

            GetTraitID(tempEthos.traitIDs, out aTrait, out bTrait);

            tempEthosObj = Instantiate(ethosObject);
            tempEthosObj.GetComponentInChildren <GovernmentHolderScript>().gov = tempEthos;
            tempEthosObj.transform.SetParent(tempResultsObj.transform, false);


            tempCivicObj = Instantiate(civicObject);
            tempCivicObj.GetComponentInChildren <GovernmentHolderScript>().gov = SelectCivic(civicID);
            tempCivicObj.transform.SetParent(tempResultsObj.transform, false);

            tempTraitContainer = Instantiate(traitContainer);
            tempTraitContainer.transform.SetParent(tempResultsObj.transform, false);

            CreateTrait(aTrait);
            CreateTrait(bTrait);
        }
    }
Exemplo n.º 3
0
		public static void RegisterPlugin(Ethos.Plugin plugin) {
			ethos_register_plugin(plugin == null ? IntPtr.Zero : plugin.Handle);
		}
Exemplo n.º 4
0
		public void RegisterPlugin(Ethos.Plugin plugin) {
			ethos_plugin_loader_register_plugin(Handle, plugin == null ? IntPtr.Zero : plugin.Handle);
		}
Exemplo n.º 5
0
		public Ethos.Plugin Load(Ethos.PluginInfo plugin_info) {
			IntPtr error = IntPtr.Zero;
			IntPtr raw_ret = ethos_plugin_loader_load(Handle, plugin_info == null ? IntPtr.Zero : plugin_info.Handle, out error);
			Ethos.Plugin ret = GLib.Object.GetObject(raw_ret) as Ethos.Plugin;
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}
Exemplo n.º 6
0
		public void Initialize(Ethos.Manager manager) {
			ethos_plugin_loader_initialize(Handle, manager == null ? IntPtr.Zero : manager.Handle);
		}
Exemplo n.º 7
0
		public unsafe bool UnloadPlugin(Ethos.PluginInfo plugin_info) {
			IntPtr error = IntPtr.Zero;
			bool raw_ret = ethos_manager_unload_plugin(Handle, plugin_info == null ? IntPtr.Zero : plugin_info.Handle, out error);
			bool ret = raw_ret;
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}
Exemplo n.º 8
0
		public Ethos.Plugin GetPlugin(Ethos.PluginInfo plugin_info) {
			IntPtr raw_ret = ethos_manager_get_plugin(Handle, plugin_info == null ? IntPtr.Zero : plugin_info.Handle);
			Ethos.Plugin ret = GLib.Object.GetObject(raw_ret) as Ethos.Plugin;
			return ret;
		}