public void OnEnable()
 {
     mapData = (MapDataStructure)target;
     mObj = new SerializedObject(target);
     mPlayerSpawnList = mObj.FindProperty("playerSpawnSpots");
     mItemSpawnList = mObj.FindProperty("itemSpawnSpots");
     mMonsterSpawnList = mObj.FindProperty("monsterSpawnSpots");
 }
Ejemplo n.º 2
0
 public void OnEnable()
 {
     mapData           = (MapDataStructure)target;
     mObj              = new SerializedObject(target);
     mPlayerSpawnList  = mObj.FindProperty("playerSpawnSpots");
     mItemSpawnList    = mObj.FindProperty("itemSpawnSpots");
     mMonsterSpawnList = mObj.FindProperty("monsterSpawnSpots");
 }
Ejemplo n.º 3
0
    public override MapData Filter(MapData t)
    {
        var perlinOffset = new Vector2(Random.value, Random.value);

        t.MapDataStructure.Map((e, i) => {
            MapDataStructure rval = e;
            var noiseValue        = Mathf.PerlinNoise((float)(i.x * horizontalScale) / t.MapDataStructure.GetLength(0) + perlinOffset.x, (float)(i.y * horizontalScale) / t.MapDataStructure.GetLength(1) + perlinOffset.y);
            rval.height           = e.height + (noiseValue + verticalOffset) * verticalScale;
            return(rval);
        });

        return(t);
    }
Ejemplo n.º 4
0
	void InitMap()
	{
		mapID = mSetUp.mapID;
		GameObject mapObject = Instantiate(mMapManager.getMap(mapID).gameObject, Vector3.zero, Quaternion.identity) as GameObject;
		mMap = mapObject.GetComponent<MapDataStructure> ();
		mMap.InitData ();
        skyboxMat = mMap.skyboxMat;
        InitSkybox();
	}