public void GenerateMap() { TileConfig[,] tileConfigs = new TileConfig[, ] { { land, mountain, land }, { land, mountain, land }, { mountain, mountain, land } }; MeshMap.GenerateMap(transform, tileConfigs); }
/// <summary> /// /// </summary> void InitMaps() { //APPEND NEW TYPES HERE if (AnimationClips == null) { AnimationClips = new AnimationClipMap(); } if (AnimatorControllers == null) { AnimatorControllers = new AnimatorControllerMap(); } if (AudioClips == null) { AudioClips = new AudioClipMap(); } if (Fonts == null) { Fonts = new FontMap(); } if (GameObjects == null) { GameObjects = new GameObjectMap(); } if (Materials == null) { Materials = new MaterialMap(); } if (Meshes == null) { Meshes = new MeshMap(); } if (PhysicMaterials == null) { PhysicMaterials = new PhysicMaterialMap(); } if (PhysicsMaterial2Ds == null) { PhysicsMaterial2Ds = new PhysicsMaterial2DMap(); } if (Shaders == null) { Shaders = new ShaderMap(); } if (Sprites == null) { Sprites = new SpriteMap(); } if (Texture2Ds == null) { Texture2Ds = new Texture2DMap(); } if (Texture3Ds == null) { Texture3Ds = new Texture3DMap(); } }
/** * Calculation of the distance between two cells * @return integer: cell distance */ public int Distance(Node dest) { MeshMap meshMap = MeshMap.Instance; Nullable <Vector2> current = meshMap.getPositionFromCell(this.cell); Nullable <Vector2> desti = meshMap.getPositionFromCell(dest.cell); if (!current.HasValue || !desti.HasValue) { return(0); } return((int)Math.Floor(Math.Sqrt(Math.Pow(desti.Value.x - current.Value.x, 2) + Math.Pow(desti.Value.y - current.Value.y, 2)))); }