1. 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;
            }  
        }
    }
     
  2. Wulf

    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.
     
  3. Hmm well i am able to do this, but it seems to delete the wrong gameobject even though it detects it. Maybe i don't really understand how removing a component works i never really needed to. Is this wrong?
    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());
                            } 
    
     
  4. Wulf

    Wulf Community Admin

    I've never worked with components, so can't really say, sorry.
     
  5. Well for future reference i if anyone looks back i actually just got it i feel stupid lmao it was just GameObject :p 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());
                            }
     
  6. KEK, you don't have class pointer and plugin reference
     
  7. I know and i am not adding it. I had a specific reason man.
     
  8. why you call tostring method on component?
    [DOUBLEPOST=1508846868][/DOUBLEPOST]what is 'e'?
     
  9. Calling a class that isn't apart of the plugin i'm working on to add compatibility

    e=entity.