/** * Puede hacerse un metodo recursivo que verifique si todas las piezas estan conectadas * */ public override bool CheckPressed() { Entity[] around = CubeHelper.GetEntitiesAround(this.transform.position); foreach (Entity e in around) { if (e is DigitalCube) { return(true); } } return(false); }
private Vector3 HasFloorAround(Vector3 v) { Entity[] around = CubeHelper.GetEntitiesAround(v); foreach (Entity e in around) { if (e.transform.position != this.transform.position && IsWalkable(e)) { return((e.transform.position - this.transform.position).normalized); } } return(Vector3.zero); }