/** * Utilisation d outils sur une case designe par tilePos sa localisation dans le repere de la scene */ public static void useTool(FarmTools tool, Vector3 tilePos) { MapTile tile = Map.getTileAt(tilePos); if (tile != null) { tile.useTool(tool); } }
public MapObject() { if (Meteo == null) { Meteo = GameObject.Find("GameTimer"); } mapX = 0; mapY = 0; tool2Destroy = FarmTools.Pickaxe; map = null; objectView = new GameObject("MapObject"); objectView.AddComponent <SpriteRenderer>(); objectView.GetComponent <SpriteRenderer>().sortingOrder = 1; objectView.GetComponent <SpriteRenderer>().material = new Material(Shader.Find("Sprites/Diffuse")); }
public void useTool(FarmTools tool) { if (tool < FarmTools.WateringCan) { if (m_object != null) { if (m_object.destroyWithTool(tool)) { removeObject(); } } } else { water(); } }
//public enum FarmerTools {Pelle, Axe, Hoe, Pickaxe, Scythe, WateringCan }; // Use this for initialization void Start() { currentTool = FarmTools.Axe; }
public virtual bool destroyWithTool(FarmTools tool) { return(tool == tool2Destroy); }
public override bool destroyWithTool(FarmTools tool) { return(tool == FarmTools.Pickaxe); }