// Neighbor Tiles Nummerierung // 5 6 7 // 4 8 0 // 3 2 1 // Weg finden die Bewegung kontinuierlich zu gestalten // Start is called before the first frame update void Start() { transform.position = new Vector3(Mathf.FloorToInt(transform.position.x), Mathf.FloorToInt(transform.position.y), 0); cmap = cmap_object.GetComponent <Cell_Map>(); x = Mathf.FloorToInt(transform.position.x); y = Mathf.FloorToInt(transform.position.y); cmap.cell_array[x, y].GetComponent <Cell>().is_occupied = true; }
// Start is called before the first frame update void Start() { cmap = GetComponentInParent <Cell_Map>(); sprite = GetComponent <SpriteRenderer>(); transform.position = new Vector3(Mathf.FloorToInt(transform.position.x), Mathf.FloorToInt(transform.position.y), 0); x_pos = Mathf.FloorToInt(transform.position.x); y_pos = Mathf.FloorToInt(transform.position.y); position2d = new Vector2Int(x_pos, y_pos); Init_Neighbors(); set_Obst_Value(); }