Lets say i have plugin a and plugin b. Plugin b has a monobehaviour class inside of it is it possible for class a to call class b's mono
Code:class PluginA : RustPlugin { void PluginAFunc() { pluginb.classmb.Delete; } }Code:class PluginB : RustPlugin { class classmb: MonoBehaviour { public void Delete() { blahblah; } } }
Solved Calling MonoBehaviour class in another plugin?
Discussion in 'Rust Development' started by ツンデレラ, Oct 24, 2017.
-
Wulf Community Admin
You might be able to if you use public classes and the // Require: PluginName at the top of the plugin, otherwise likely not.
-
Code:var arrayt =e.GetComponents(typeof(Component)); foreach(gameObject test in arrayt){ if(test.ToString()=="assets/rust.ai/agents/horse/horse.prefab (classmb)"){ SendReply(player,"test."+test); test.gameObject.Destroy(test); } Puts(test.ToString()); }
-
Wulf Community Admin
-
no need for test.GameObject
Code:var array =e.GetComponents(typeof(Component)); foreach(var test in array){ if(test.ToString()=="class/prefab/director.prefab (classmonobehaviour)"){ SendReply(player,"test"); GameObject.Destroy(test); } Puts(test.ToString()); }
-
KEK, you don't have class pointer and plugin reference
-
-
why you call tostring method on component?
[DOUBLEPOST=1508846868][/DOUBLEPOST]what is 'e'? -
e=entity.