c# - CS1501 "No overload for method `Weight' takes `0' arguments" -


i getting following error following classes in unity engine.

error:

no overload method 'weight' takes '0' arguments 

child class:

using unityengine; using system.collections;  public class createhammerstone : monobehaviour {    private basetool newtool;  void start(){     debug.log (newtool.weight());  }    public void createtool() {      newtool = new basetool ();      //assign name tool     newtool.itemname = "hammer stone";     //create weapon description     newtool.itemdescription = "the hammer stone rather universal blunt tool primarly used strike off lithic flakes in procces of stone tool crafting. alternatively can used breaking hard nuts,shells etc. or executing small prey";      //tool id     newtool.itemid = 1;     //stats     newtool.density = 2.6f; //gram pr cm3      newtool.volume = 360f;  //cm3     newtool.weight(newtool.density, newtool.volume); // here issue!!!!     //choose type of tool     newtool.tooltype = basetool.tooltypes.crafting;  } } 

parent class:

using unityengine; using system.collections;  public class basestatsitem : baseitem {  private float volume; private float density; private int willpower; private int perception; private int intelligence;     public float volume {     {return volume;}     set {volume = value;}  } public float density {     { return density;}     set { density = value;} }  public int willpower{     {return willpower;}     set {willpower = value;} } public int perception{     {return perception;}     set {perception = value;} } public int intelligence{     {return intelligence;}     set {intelligence = value;} }  public float weight(float density, float volume){ // here function!!     float sum = density * volume;     return sum;   }     } 

as can see seems takes no arguments. guess it's because volume , density assigned @ same time weight function, still no information weight function retrieve. right? , how fix that?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -