Hello,
I’m trying to use class for the first time and I don’t understand what is wrong :
#pragma strict
public class MapBase
{
public var latitude : float;
public var longitude : float;
public function MapBase(latitude:float,longitude:float)
{
Debug.Log("MapBase invoked");
this.latitude = latitude;
this.longitude = longitude;
}
public function getLatitude()
{
return latitude;
}
public function getLongitude()
{
return longitude;
}
}
public class AutoGPS extends MapBase
{
public function AutoGPS(latitude : float, longitude : float)
{
Debug.Log(this.getLatitude());
}
}
function Start()
{
var gps:AutoGPS = new AutoGPS(10.32,32.1);
}
the error is :
Assets/NewBehaviourScript.js(28,21): BCE0024: The type ‘MapBase’ does not have a visible constructor that matches the argument list ‘()’.
Thanks for the help !